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 depthTesting(
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;
102 byte _defaultStippleArray[128] = {
103 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
104 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
105 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
106 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
107 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
108 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
109 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
110 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
111 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
112 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
113 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
114 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
115 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
116 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
117 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
118 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
125 #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