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"
60class 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;
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
Definition: graphicengine.h:83
void updateLastFrameDuration()
bool fill(const Common::Rect *fillRectPtr=0, uint color=(0xFF000000|((0)<< 16)|((0)<< 8)|((0)<< 0)))
bool init(int width=800, int height=600, int bitDepth=16, int backbufferCount=2)
void drawDebugLine(const Vertex &start, const Vertex &end, uint color=(0xFF000000|((255)<< 16)|((255)<< 8)|((255)<< 0)))
int getLastFrameDurationMicro() const
Definition: graphicengine.h:150
bool startFrame(bool updateAll=false)
bool isWindowed()
Definition: graphicengine.h:223
int getBitDepth()
Definition: graphicengine.h:203
bool canLoadResource(const Common::String &fileName) override
float getLastFrameDuration() const
Definition: graphicengine.h:159
bool saveThumbnailScreenshot(const Common::String &filename)
int getDisplayHeight() const
Definition: graphicengine.h:189
int getDisplayWidth() const
Definition: graphicengine.h:182
Common::Rect & getDisplayRect()
Definition: graphicengine.h:196
void setVsync(bool vsync)
Resource * loadResource(const Common::String &fileName) override
Definition: outputpersistenceblock.h:39
Definition: persistable.h:39
Definition: renderobjectptr.h:46
Definition: resource.h:43
Definition: resservice.h:43
Definition: display_client.h:53