22 #ifndef FREESCAPE_GFX_TINYGL_H 23 #define FREESCAPE_GFX_TINYGL_H 25 #include "math/vector3d.h" 26 #include "common/hashmap.h" 28 #include "freescape/gfx.h" 29 #include "freescape/gfx_tinygl_texture.h" 45 void copyToVertexArray(uint idx,
const Math::Vector3d &src) {
46 assert(idx < kVertexArraySize);
47 _verts[idx].x = src.x();
48 _verts[idx].y = src.y();
49 _verts[idx].z = src.z();
59 void copyToTexCoordArray(uint idx,
float x,
float y) {
60 assert(idx < kVertexArraySize);
68 uint32 _lastColorSet0;
69 uint32 _lastColorSet1;
71 virtual void init()
override;
72 virtual void clear(uint8 r, uint8 g, uint8 b,
bool ignoreViewport =
false)
override;
73 virtual void setViewport(
const Common::Rect &rect)
override;
74 virtual void positionCamera(
const Math::Vector3d &pos,
const Math::Vector3d &interest,
float rollAngle = 0.0f)
override;
75 virtual void updateProjectionMatrix(
float fov,
float aspectRatio,
float nearClipPlane,
float farClipPlane)
override;
77 virtual void useColor(uint8 r, uint8 g, uint8 b)
override;
78 virtual void polygonOffset(
bool enabled)
override;
79 virtual void enableCulling(
bool enabled)
override;
80 virtual void setStippleData(byte *data)
override;
81 virtual void useStipple(
bool enabled)
override;
84 void freeTexture(
Texture *texture)
override;
86 void drawSkybox(
Texture *texture, Math::Vector3d camera)
override;
87 void drawThunder(
Texture *texture, Math::Vector3d camera,
float size)
override;
89 virtual void renderSensorShoot(byte color,
const Math::Vector3d sensor,
const Math::Vector3d player,
const Common::Rect &viewPort)
override;
90 virtual void renderPlayerShootBall(byte color,
const Common::Point &position,
int frame,
const Common::Rect &viewPort)
override;
92 virtual void renderCrossair(
const Common::Point &crossairPosition)
override;
96 void drawCelestialBody(Math::Vector3d position,
float radius, byte color)
override;
99 virtual void drawFloor(uint8 color)
override;
100 virtual void fillViewportStippled(uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2, byte *stipple)
override;
103 byte _defaultStippleArray[128] = {
104 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
105 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
106 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
107 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
108 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
109 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
110 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
111 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
112 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
113 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
114 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
115 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
116 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
117 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
118 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
119 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
126 #endif // FREESCAPE_GFX_TINYGL_H
virtual void flipBuffer() override
Definition: gfx_tinygl.h:38
RenderMode
Definition: rendermode.h:48
Definition: gfx_tinygl_texture.h:49
virtual void positionCamera(const Math::Vector3d &pos, const Math::Vector3d &interest, float rollAngle=0.0f) override
Definition: gfx_tinygl.h:33
Definition: gfx_tinygl.h:52