wavelength 1.0.0
Loading...
Searching...
No Matches
rndrenderer.h
Go to the documentation of this file.
1#pragma once
2
3#include "math/color.h"
4#include "math/rect.h"
5#include "math/vector2.h"
6
14public:
22
31 virtual void Init();
32
41 virtual void Terminate();
42
50 virtual void SetClearColor(const Color &color);
51
60 virtual void SetShowTimers(int bShow, int nMaxMs);
61
69 virtual void SetShowStats(int bShow);
70
78 virtual void SetShowRate(int bShow);
79
88 virtual void DumpStats();
89
99 virtual void ScreenDump(const char *pszName);
100
111 virtual void DrawRect(const Rect &rect, const Color &color);
112
126 virtual float DrawString(const char *pszText,
127 const Vector2 &pos,
128 const Vector2 &charSize,
129 const Color &color);
130
139 virtual void BeginFrame();
140
149 virtual void EndFrame();
150
159 virtual void ClearAndFlip();
160
170
180 virtual float AspectRatio();
181
191 virtual bool SupportsTextures();
192
194 const Color &GetClearColor() const {
195 return mClearColor;
196 }
197
199 int GetFrameCount() const {
200 return mFrameCount;
201 }
202
204 int GetScreenHeight() const {
205 return mScreenHeight;
206 }
207
209 int GetScreenWidth() const {
210 return mScreenWidth;
211 }
212
214 int GetTimerMaxMs() const {
215 return mTimerMaxMs;
216 }
217
218protected:
220
222
224
226
228
230
232
234
236};
237
243extern RndRenderer *TheRnd;
Base of the platform renderer, the owner of the display and of the frame.
Definition rndrenderer.h:13
virtual void SetClearColor(const Color &color)
Set the colour the frame is cleared to.
int mScreenWidth
Definition rndrenderer.h:221
virtual float AspectRatio()
Report the height of a pixel relative to its width.
virtual void RestoreFrameBufferTarget()
Point drawing at the back buffer again.
int mShowTimers
Definition rndrenderer.h:231
int mScreenBpp
Definition rndrenderer.h:225
virtual void SetShowStats(int bShow)
Show or hide the statistics overlay.
int mFrameCount
Definition rndrenderer.h:229
int mTimerMaxMs
Definition rndrenderer.h:227
int mScreenHeight
Definition rndrenderer.h:223
virtual void ClearAndFlip()
Clear the back buffer and present it outside a frame.
virtual float DrawString(const char *pszText, const Vector2 &pos, const Vector2 &charSize, const Color &color)
Draw text with the line font.
virtual void SetShowRate(int bShow)
Show or hide the frame rate overlay.
virtual void SetShowTimers(int bShow, int nMaxMs)
Show or hide the timer overlay.
int GetScreenWidth() const
Definition rndrenderer.h:209
Color mClearColor
Definition rndrenderer.h:219
int GetScreenHeight() const
Definition rndrenderer.h:204
virtual void Terminate()
Shut down the display.
virtual void EndFrame()
Close the frame BeginFrame() opened and present it.
int GetFrameCount() const
Definition rndrenderer.h:199
virtual void DumpStats()
Write the drawing statistics.
const Color & GetClearColor() const
Definition rndrenderer.h:194
virtual void DrawRect(const Rect &rect, const Color &color)
Fill a rectangle of the screen.
virtual void ScreenDump(const char *pszName)
Save the frame to an image file.
RndRenderer()
Set an opaque grey of 0.3, a display of 640 by 480 at 16 bits, and a timer ceiling of 50.
virtual void BeginFrame()
Open a frame.
int mShowRate
Definition rndrenderer.h:235
virtual void Init()
Read the rnd section of the configuration.
virtual bool SupportsTextures()
Report whether the renderer reads texture files.
int GetTimerMaxMs() const
Definition rndrenderer.h:214
int mShowStats
Definition rndrenderer.h:233
RndRenderer * TheRnd
The renderer, the Ps instance at 0x0043ba00 seen through its base.
Linear colour with four float components.
Definition color.h:12
Axis-aligned rectangle given by a corner and a size.
Definition rect.h:11
Two-component vector, used for texture coordinates.
Definition vector2.h:12