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);
139 return _lastFrameDuration;
148 return static_cast<float>(_lastFrameDuration) / 1000000.0f;
151 void stopMainTimer() {
152 _timerActive =
false;
155 void resumeMainTimer() {
159 float getSecondaryFrameDuration()
const {
160 return static_cast<float>(_lastFrameDuration) / 1000000.0f;
215 bool fill(
const Common::Rect *fillRectPtr = 0, uint color = BS_RGB(0, 0, 0));
235 static void ARGBColorToLuaColor(
lua_State *L, uint color);
236 static uint luaColorToARGBColor(
lua_State *L,
int stackIndex);
253 bool registerScriptBindings();
254 void unregisterScriptBindings();
259 uint _lastFrameDuration;
262 uint _frameTimeSampleSlot;
272 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:168
Definition: renderobjectptr.h:46
bool startFrame(bool updateAll=false)
Common::Rect & getDisplayRect()
Definition: graphicengine.h:182
bool saveThumbnailScreenshot(const Common::String &filename)
Definition: resource.h:43
void setVsync(bool vsync)
Definition: persistable.h:39
int getDisplayHeight() const
Definition: graphicengine.h:175
Definition: resservice.h:43
Resource * loadResource(const Common::String &fileName) override
void updateLastFrameDuration()
float getLastFrameDuration() const
Definition: graphicengine.h:145
int getBitDepth()
Definition: graphicengine.h:189
bool fill(const Common::Rect *fillRectPtr=0, uint color=(0xFF000000|((0)<< 16)|((0)<< 8)|((0)<< 0)))
int getLastFrameDurationMicro() const
Definition: graphicengine.h:136
bool canLoadResource(const Common::String &fileName) override
Definition: movie_decoder.h:32
Definition: outputpersistenceblock.h:39
Definition: graphicengine.h:83