3#ifndef GDK_GFX_WEBGL1ES2_TEXTURE_CAMERA_H
4#define GDK_GFX_WEBGL1ES2_TEXTURE_CAMERA_H
7#include <gdk/graphics_types.h>
8#include <gdk/texture_camera.h>
9#include <gdk/webgl1es2_camera.h>
10#include <gdk/webgl1es2_texture.h>
12#include <jfc/unique_handle.h>
28 const float aNearClippingPlane,
29 const float aFarClippingPlane,
30 const float aViewportAspectRatio)
override;
34 const float aNearClippingPlane,
35 const float aFarClippingPlane,
36 const float aViewportAspectRatio)
override;
43 const gdk::graphics_quaternion_type& aRotation)
override;
44 virtual void set_transform(
const gdk::graphics_matrix4x4_type &aMatrix)
override;
46 virtual const std::shared_ptr<gdk::texture>
get_color_texture(
const size_t i)
const override;
54 void activate()
const;
57 webgl1es2_texture_camera(
const graphics_intvector2_type &textureSize = {1024, 1024});
62 graphics_intvector2_type m_TextureSize;
65 jfc::unique_handle<GLuint> m_FrameBufferHandle;
68 jfc::unique_handle<GLuint> m_DepthBuffer;
71 mutable std::optional<std::shared_ptr<webgl1es2_texture>> m_ColorBufferTexture;
74 mutable std::optional<std::shared_ptr<webgl1es2_texture>> m_DepthBufferTexture;
clear_mode
controls which buffers in the active frame buffer object to clear
Definition camera.h:13
represents an observable 3d object.
Definition entity.h:13
texture camera renders to textures instead of the screen
Definition texture_camera.h:12
webgl1es2_camera(const webgl1es2_camera &a)=default
copy semantics
webgl1es2_camera implementation of texture_camera
Definition webgl1es2_texture_camera.h:22
virtual void set_clear_color(const gdk::color &acolor) override
sets the clear color, used to fill color buffer after it is cleared.
virtual const std::shared_ptr< gdk::texture > get_depth_texture() const override
get the texture attached to the depth buffer
virtual void set_perspective_projection(const float aFieldOfView, const float aNearClippingPlane, const float aFarClippingPlane, const float aViewportAspectRatio) override
sets the projection matrix to a perspective projection
virtual void set_clear_mode(const clear_mode aClearMode) override
clear mode decides which buffers to clear. see enum
virtual void set_orthographic_projection(const float aWidth, const float aHeight, const float aNearClippingPlane, const float aFarClippingPlane, const float aViewportAspectRatio) override
sets the projection matrix to an orthographic projection
virtual void set_transform(const gdk::graphics_vector3_type &aWorldPos, const gdk::graphics_quaternion_type &aRotation) override
checks whether a point in world space is within the camera's frustum
virtual const std::shared_ptr< gdk::texture > get_color_texture(const size_t i) const override
get a texture attached to the color buffer
Represents a 4 channel color: {Red, Green, Blue, Alpha}. TODO: channel values should be limited to th...
Definition color.h:11