gdk-graphics 0b051eb9b5c1eaa0658babaa4463dd7a80aa9d2c
Loading...
Searching...
No Matches
webgl1es2_screen_camera.h
1// © Joseph Cameron - All Rights Reserved
2
3#ifndef GDK_GFX_WEBGL1ES2_SCREEN_CAMERA_H
4#define GDK_GFX_WEBGL1ES2_SCREEN_CAMERA_H
5
6#include <gdk/color.h>
7#include <gdk/graphics_types.h>
8#include <gdk/screen_camera.h>
9#include <gdk/webgl1es2_camera.h>
10#include <gdk/webgl1es2_texture.h>
11#include <jfc/unique_handle.h>
12
13#include <memory>
14#include <vector>
15
16namespace gdk {
17 class entity;
18
21 public:
24 //
26 virtual void set_viewport(const float aX,
27 const float aY,
28 const float aWidth,
29 const float aHeight) override;
30
32 virtual void set_perspective_projection(const float aFieldOfView,
33 const float aNearClippingPlane,
34 const float aFarClippingPlane,
35 const float aViewportAspectRatio) override;
36
38 virtual void set_orthographic_projection(const float aWidth,
39 const float aHeight,
40 const float aNearClippingPlane,
41 const float aFarClippingPlane,
42 const float aViewportAspectRatio) override;
43
45 virtual void set_transform(const gdk::graphics_vector3_type &aWorldPos,
46 const gdk::graphics_quaternion_type &aRotation) override;
47 virtual void set_transform(const gdk::graphics_matrix4x4_type &aMatrix) override;
48
50 virtual void set_clear_color(const gdk::color &acolor) override;
51
53 virtual void set_clear_mode(const gdk::camera::clear_mode aClearMode) override;
55
58 //
60 void activate(const gdk::graphics_intvector2_type& aFrameBufferSize) const;
62
67
72
75
76 virtual ~webgl1es2_screen_camera() = default;
77
78 private:
79 graphics_vector2_type m_ViewportPosition = graphics_vector2_type::Zero;
80 graphics_vector2_type m_ViewportSize = graphics_vector2_type(1, 1);
81 };
82}
83
84#endif
85
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
Position, orientation and perspective from which entity(s) are drawn.
Definition screen_camera.h:15
webgl1es2_camera(const webgl1es2_camera &a)=default
copy semantics
virtual void set_clear_mode(const gdk::camera::clear_mode aClearMode) override
clear mode decides which buffers to clear. see enum
void activate(const gdk::graphics_intvector2_type &aFrameBufferSize) const
activates this camera; mutates gl according to this camera's state
webgl1es2_screen_camera & operator=(webgl1es2_screen_camera &&a)=default
move semantics
webgl1es2_screen_camera()
constructs with reasonable default values
virtual void set_transform(const gdk::graphics_vector3_type &aWorldPos, const gdk::graphics_quaternion_type &aRotation) override
rebuilds the view matrix from a 3d position and rotation
webgl1es2_screen_camera & operator=(const webgl1es2_screen_camera &a)=default
copy semantics
webgl1es2_screen_camera(const webgl1es2_screen_camera &a)=default
copy semantics
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_viewport(const float aX, const float aY, const float aWidth, const float aHeight) override
sets the normalized size and position of the viewport within of the window
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
webgl1es2_screen_camera(webgl1es2_screen_camera &&)=default
move semantics
virtual void set_clear_color(const gdk::color &acolor) override
sets the clear color, used to fill color buffer after it is cleared.
Represents a 4 channel color: {Red, Green, Blue, Alpha}. TODO: channel values should be limited to th...
Definition color.h:11