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> 30 const float aNearClippingPlane,
31 const float aFarClippingPlane,
32 const float aViewportAspectRatio)
override;
36 const float aNearClippingPlane,
37 const float aFarClippingPlane,
38 const float aViewportAspectRatio)
override;
44 virtual void set_view_matrix(
const gdk::graphics_vector3_type& aWorldPos,
45 const gdk::graphics_quaternion_type& aRotation)
override;
47 virtual const std::shared_ptr<gdk::texture>
get_color_texture(
size_t i)
const override;
55 void activate()
const;
63 graphics_intvector2_type m_TextureSize;
66 jfc::unique_handle<GLuint> m_FrameBufferHandle;
69 jfc::unique_handle<GLuint> m_DepthBuffer;
72 mutable std::optional<std::shared_ptr<webgl1es2_texture>> m_ColorBufferTexture;
75 mutable std::optional<std::shared_ptr<webgl1es2_texture>> m_DepthBufferTexture;
texture camera renders to textures instead of the screen
Definition: texture_camera.h:13
virtual void set_clear_color(const gdk::color &acolor) override
sets the clear color, used to fill color buffer after it is cleared.
virtual void set_clear_mode(const clear_mode aClearMode) override
clear mode decides which buffers to clear. see enum
webgl1es2_camera implementation of texture_camera
Definition: webgl1es2_texture_camera.h:23
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 const std::shared_ptr< gdk::texture > get_color_texture(size_t i) const override
get a texture attached to the color buffer
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
clear_mode
Describes camera clear behaviour: which buffers in the current FBO should be cleared?
Definition: camera.h:16
virtual void set_view_matrix(const gdk::graphics_vector3_type &aWorldPos, const gdk::graphics_quaternion_type &aRotation) override
rebuilds the view matrix from a 3d position and rotation
webgl1es2_camera implementation of camera
Definition: webgl1es2_camera.h:21
virtual const std::shared_ptr< gdk::texture > get_depth_texture() const override
get the texture attached to the depth buffer
Represents a 4 channel color: {Red, Green, Blue, Alpha}.
Definition: color.h:11