39 #ifndef SWORD25_GRAPHICENGINE_H 40 #define SWORD25_GRAPHICENGINE_H 43 #include "common/array.h" 44 #include "common/rect.h" 45 #include "common/ptr.h" 46 #include "common/str.h" 47 #include "graphics/managed_surface.h" 48 #include "sword25/kernel/common.h" 49 #include "sword25/kernel/resservice.h" 50 #include "sword25/kernel/persistable.h" 51 #include "sword25/gfx/renderobjectptr.h" 52 #include "sword25/math/vertex.h" 60 class RenderObjectManager;
67 #define BS_AMASK 0xFF000000 68 #define BS_RMASK 0x00FF0000 69 #define BS_GMASK 0x0000FF00 70 #define BS_BMASK 0x000000FF 72 #define BS_RGBMASK (BS_RMASK | BS_GMASK | BS_BMASK) 73 #define BS_ARGBMASK (BS_AMASK | BS_RMASK | BS_GMASK | BS_BMASK) 75 #define BS_RGB(R,G,B) (BS_AMASK | ((R) << BS_RSHIFT) | ((G) << BS_GSHIFT) | ((B) << BS_BSHIFT)) 76 #define BS_ARGB(A,R,G,B) (((A) << BS_ASHIFT) | ((R) << BS_RSHIFT) | ((G) << BS_GSHIFT) | ((B) << BS_BSHIFT)) 103 bool init(
int width = 800,
int height = 600,
int bitDepth = 16,
int backbufferCount = 2);
153 return _lastFrameDuration;
162 return static_cast<float>(_lastFrameDuration) / 1000000.0f;
165 void stopMainTimer() {
166 _timerActive =
false;
169 void resumeMainTimer() {
173 float getSecondaryFrameDuration()
const {
174 return static_cast<float>(_lastFrameDuration) / 1000000.0f;
236 bool fill(
const Common::Rect *fillRectPtr = 0, uint color = BS_RGB(0, 0, 0));
256 static void ARGBColorToLuaColor(
lua_State *L, uint color);
257 static uint luaColorToARGBColor(
lua_State *L,
int stackIndex);
274 bool registerScriptBindings();
275 void unregisterScriptBindings();
280 uint _lastFrameDuration;
283 uint _frameTimeSampleSlot;
293 DebugLine(
const Vertex &start,
const Vertex &end, uint color) :
Definition: managed_surface.h:51
bool init(int width=800, int height=600, int bitDepth=16, int backbufferCount=2)
int getDisplayWidth() const
Definition: graphicengine.h:182
void drawDebugLine(const Vertex &start, const Vertex &end, uint color=(0xFF000000|((255)<< 16)|((255)<< 8)|((255)<< 0)))
Definition: renderobjectptr.h:46
bool startFrame(bool updateAll=false)
Common::Rect & getDisplayRect()
Definition: graphicengine.h:196
bool isWindowed()
Definition: graphicengine.h:223
bool saveThumbnailScreenshot(const Common::String &filename)
Definition: resource.h:43
void setVsync(bool vsync)
Definition: persistable.h:39
int getDisplayHeight() const
Definition: graphicengine.h:189
Definition: resservice.h:43
Resource * loadResource(const Common::String &fileName) override
void updateLastFrameDuration()
float getLastFrameDuration() const
Definition: graphicengine.h:159
int getBitDepth()
Definition: graphicengine.h:203
bool fill(const Common::Rect *fillRectPtr=0, uint color=(0xFF000000|((0)<< 16)|((0)<< 8)|((0)<< 0)))
int getLastFrameDurationMicro() const
Definition: graphicengine.h:150
bool canLoadResource(const Common::String &fileName) override
Definition: movie_decoder.h:32
Definition: outputpersistenceblock.h:39
Definition: graphicengine.h:83