Quellcode durchsuchen

Added the ability to specify whether a window is borderless or not (decorated with borders);
Added the ability that if in windowed mode and the passed in size is 0 || 0 then it will maximize
Added the ability to maximize and minimize the window

Alex Parlett vor 12 Jahren
Ursprung
Commit
a63ab49ac5

+ 2 - 1
Source/Engine/Engine/Engine.cpp

@@ -274,6 +274,7 @@ bool Engine::Initialize(const VariantMap& parameters)
             GetParameter(parameters, "WindowWidth", 0).GetInt(),
             GetParameter(parameters, "WindowHeight", 0).GetInt(),
             GetParameter(parameters, "FullScreen", true).GetBool(),
+            GetParameter(parameters, "Borderless", false).GetBool(),
             GetParameter(parameters, "WindowResizable", false).GetBool(),
             GetParameter(parameters, "VSync", false).GetBool(),
             GetParameter(parameters, "TripleBuffer", false).GetBool(),
@@ -286,7 +287,7 @@ bool Engine::Initialize(const VariantMap& parameters)
         renderer->SetDrawShadows(GetParameter(parameters, "Shadows", true).GetBool());
         if (renderer->GetDrawShadows() && GetParameter(parameters, "LowQualityShadows", false).GetBool())
             renderer->SetShadowQuality(SHADOWQUALITY_LOW_16BIT);
-
+    
         if (GetParameter(parameters, "Sound", true).GetBool())
         {
             GetSubsystem<Audio>()->SetMode(

+ 66 - 18
Source/Engine/Graphics/Direct3D9/D3D9Graphics.cpp

@@ -286,44 +286,50 @@ void Graphics::SetWindowPosition(int x, int y)
     SetWindowPosition(IntVector2(x, y));
 }
 
-bool Graphics::SetMode(int width, int height, bool fullscreen, bool resizable, bool vsync, bool tripleBuffer, int multiSample)
+bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless, bool resizable, bool vsync, bool tripleBuffer, int multiSample)
 {
     PROFILE(SetScreenMode);
+
+    bool maximize = false;
     
     // Find out the full screen mode display format (match desktop color depth)
     SDL_DisplayMode mode;
     SDL_GetDesktopDisplayMode(0, &mode);
     D3DFORMAT fullscreenFormat = SDL_BITSPERPIXEL(mode.format) == 16 ? D3DFMT_R5G6B5 : D3DFMT_X8R8G8B8;
     
-    // If zero dimensions in windowed mode, set default. If zero in fullscreen, use desktop mode
+    // If zero dimensions in windowed mode, ignore well use the maximize flag. If zero in fullscreen, use desktop mode
     if (!width || !height)
     {
-        if (!fullscreen)
+        if (fullscreen || borderless)
         {
-            width = 1024;
-            height = 768;
+            width = mode.w;
+            height = mode.h;
         }
         else
         {
-            width = mode.w;
-            height = mode.h;
+            maximize = true;
+            width = 1024;
+            height = 768;
         }
     }
     
-    // Fullscreen can not be resizable
-    if (fullscreen)
+    // Fullscreen or Borderless can not be resizable
+    if(fullscreen || borderless)
         resizable = false;
+
+    if(borderless)
+        fullscreen = false;
     
     multiSample = Clamp(multiSample, 1, (int)D3DMULTISAMPLE_16_SAMPLES);
     
     // If nothing changes, do not reset the device
-    if (width == width_ && height == height_ && fullscreen == fullscreen_ &&  resizable == resizable_ &&
+    if (width == width_ && height == height_ && fullscreen == fullscreen_ && borderless == borderless_ && resizable == resizable_ &&
         vsync == vsync_ && tripleBuffer == tripleBuffer_ && multiSample == multiSample_)
         return true;
     
     if (!impl_->window_)
     {
-        if (!OpenWindow(width, height, resizable))
+        if (!OpenWindow(width, height, resizable, borderless))
             return false;
     }
     
@@ -361,7 +367,12 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool resizable, b
             multiSample = 1;
     }
     
-    AdjustWindow(width, height, fullscreen);
+    AdjustWindow(width, height, fullscreen, borderless);
+
+    if(maximize)
+    {
+        Maximize();
+    }
     
     if (fullscreen)
     {
@@ -394,6 +405,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool resizable, b
     width_ = width;
     height_ = height;
     fullscreen_ = fullscreen;
+    borderless_ = borderless;
     resizable_ = resizable;
     vsync_ = vsync;
     tripleBuffer_ = tripleBuffer;
@@ -432,6 +444,8 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool resizable, b
     #ifdef ENABLE_LOGGING
     String msg;
     msg.AppendWithFormat("Set screen mode %dx%d %s", width_, height_, (fullscreen_ ? "fullscreen" : "windowed"));
+    if(borderless_)
+        msg.Append(" borderless");
     if (resizable_)
         msg.Append(" resizable");
     if (multiSample > 1)
@@ -446,6 +460,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool resizable, b
     eventData[P_HEIGHT] = height_;
     eventData[P_FULLSCREEN] = fullscreen_;
     eventData[P_RESIZABLE] = resizable_;
+    eventData[P_BORDERLESS] = borderless_;
     SendEvent(E_SCREENMODE, eventData);
     
     return true;
@@ -468,7 +483,7 @@ void Graphics::SetFlushGPU(bool enable)
 
 bool Graphics::ToggleFullscreen()
 {
-    return SetMode(width_, height_, !fullscreen_, resizable_, vsync_, tripleBuffer_, multiSample_);
+    return SetMode(width_, height_, !fullscreen_, borderless_, resizable_, vsync_, tripleBuffer_, multiSample_);
 }
 
 void Graphics::Close()
@@ -1994,9 +2009,26 @@ void Graphics::WindowResized()
     eventData[P_HEIGHT] = height_;
     eventData[P_FULLSCREEN] = fullscreen_;
     eventData[P_RESIZABLE] = resizable_;
+    eventData[P_BORDERLESS] borderless_;
     SendEvent(E_SCREENMODE, eventData);
 }
 
+void Graphics::Maximize()
+{
+    if(!impl_->window_)
+        return;
+
+    SDL_MaximizeWindow(impl_->window_);
+}
+
+void Graphics::Minimize()
+{
+    if(!impl_->window_)
+        return;
+
+    SDL_MinimizeWindow(impl_->window_);
+}
+
 void Graphics::AddGPUObject(GPUObject* object)
 {
     gpuObjects_.Push(object);
@@ -2197,10 +2229,18 @@ unsigned Graphics::GetFormat(const String& formatName)
     return GetRGBFormat();
 }
 
-bool Graphics::OpenWindow(int width, int height, bool resizable)
+bool Graphics::(int width, int height, bool resizable, bool borderless, bool fullscreen)
 {
-    if (!externalWindow_)
-        impl_->window_ = SDL_CreateWindow(windowTitle_.CString(), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, resizable ? SDL_WINDOW_RESIZABLE : 0);
+    if(!externalWindow_)
+    {
+        unsigned flags = 0;
+        if(resizable)
+            flags |= SDL_WINDOW_RESIZABLE;
+        if(borderless)
+            flags |= SDL_WINDOW_BORDERLESS;
+
+        impl_->window_ = SDL_CreateWindow(windowTitle_.CString(), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, flags);
+    }
     else
         impl_->window_ = SDL_CreateWindowFrom(externalWindow_, 0);
     
@@ -2228,12 +2268,20 @@ void Graphics::CreateWindowIcon()
     }
 }
 
-void Graphics::AdjustWindow(int& newWidth, int& newHeight, bool& newFullscreen)
+void Graphics::AdjustWindow(int& newWidth, int& newHeight, bool& newFullscreen, bool& newBorderless)
 {
     if (!externalWindow_)
     {
-        SDL_SetWindowSize(impl_->window_, newWidth, newHeight);
+        if(!newWidth || !newHeight)
+        {
+            SDL_MaximizeWindow(impl_->window_);
+            SDL_GetWindowSize(impl_->window_, &newWidth, &newHeight);
+        }
+        else
+            SDL_SetWindowSize(impl_->window_, newWidth, newHeight);
+
         SDL_SetWindowFullscreen(impl_->window_, newFullscreen ? SDL_TRUE : SDL_FALSE);
+        SDL_SetWindowBordered(impl_->window_, newBorderless ? SDL_TRUE : SDL_FALSE);
     }
     else
     {

+ 11 - 3
Source/Engine/Graphics/Direct3D9/D3D9Graphics.h

@@ -90,7 +90,7 @@ public:
     /// Set window position.
     void SetWindowPosition(int x, int y);
     /// Set screen mode. Return true if successful.
-    bool SetMode(int width, int height, bool fullscreen, bool resizable, bool vsync, bool tripleBuffer, int multiSample);
+    bool SetMode(int width, int height, bool fullscreen, bool borderless, bool resizable, bool vsync, bool tripleBuffer, int multiSample);
     /// Set screen resolution only. Return true if successful.
     bool SetMode(int width, int height);
     /// Set whether the main window uses sRGB conversion on write.
@@ -234,6 +234,8 @@ public:
     bool GetFullscreen() const { return fullscreen_; }
     /// Return whether window is resizable.
     bool GetResizable() const { return resizable_; }
+    /// Return whether window is borderless.
+    bool GetBorderless() const { return borderless_; }
     /// Return whether vertical sync is on.
     bool GetVSync() const { return vsync_; }
     /// Return whether triple buffering is enabled.
@@ -347,6 +349,10 @@ public:
     
     /// Window was resized through user interaction. Called by Input subsystem.
     void WindowResized();
+    /// Maximize the Window
+    void Maximize();
+    /// Minimize the Window
+    void Minimize();
     /// Add a GPU object to keep track of. Called by GPUObject.
     void AddGPUObject(GPUObject* object);
     /// Remove a GPU object. Called by GPUObject.
@@ -393,11 +399,11 @@ public:
     
 private:
     /// Create the application window.
-    bool OpenWindow(int width, int height, bool resizable);
+    bool OpenWindow(int width, int height, bool resizable, bool borderless);
     /// Create the application window icon.
     void CreateWindowIcon();
     /// Adjust the window for new resolution and fullscreen mode.
-    void AdjustWindow(int& newWidth, int& newHeight, bool& newFullscreen);
+    void AdjustWindow(int& newWidth, int& newHeight, bool& newFullscreen, bool& newBorderless);
     /// Create the Direct3D interface.
     bool CreateInterface();
     /// Create the Direct3D device.
@@ -431,6 +437,8 @@ private:
     int multiSample_;
     /// Fullscreen flag.
     bool fullscreen_;
+    /// Borderless flag.
+    bool borderless_;
     /// Resizable flag.
     bool resizable_;
     /// Vertical sync flag.

+ 1 - 0
Source/Engine/Graphics/GraphicsEvents.h

@@ -44,6 +44,7 @@ EVENT(E_SCREENMODE, ScreenMode)
     PARAM(P_HEIGHT, Height);                // int
     PARAM(P_FULLSCREEN, Fullscreen);        // bool
     PARAM(P_RESIZABLE, Resizable);          // bool
+    PARAM(P_BORDERLESS, Borderless);        // bool
 }
 
 /// Graphics features checked.

+ 50 - 16
Source/Engine/Graphics/OpenGL/OGLGraphics.cpp

@@ -157,6 +157,7 @@ Graphics::Graphics(Context* context_) :
     multiSample_(1),
     fullscreen_(false),
     resizable_(false),
+    borderless_(false),
     vsync_(false),
     tripleBuffer_(false),
     sRGB_(false),
@@ -231,22 +232,28 @@ void Graphics::SetWindowPosition(int x, int y)
     SetWindowPosition(IntVector2(x, y));
 }
 
-bool Graphics::SetMode(int width, int height, bool fullscreen, bool resizable, bool vsync, bool tripleBuffer, int multiSample)
+bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless, bool resizable, bool vsync, bool tripleBuffer, int multiSample)
 {
     PROFILE(SetScreenMode);
+
+    bool maximize = false;
     
-    // Fullscreen can not be resizable
-    if (fullscreen)
+    // Fullscreen or Borderless can not be resizable
+    if (fullscreen || borderless)
         resizable = false;
+
+    // Borderless cannot be fullscreen, they are mutually exclusive
+    if (borderless)
+        fullscreen = false;
     
     multiSample = Clamp(multiSample, 1, 16);
     
-    if (IsInitialized() && width == width_ && height == height_ && fullscreen == fullscreen_ && resizable == resizable_ &&
+    if (IsInitialized() && width == width_ && height == height_ && fullscreen == fullscreen_ && borderless == borderless_ && resizable == resizable_ &&
         vsync == vsync_ && tripleBuffer == tripleBuffer_ && multiSample == multiSample_)
         return true;
     
     // If only vsync changes, do not destroy/recreate the context
-    if (IsInitialized() && width == width_ && height == height_ && fullscreen == fullscreen_ && resizable == resizable_ &&
+    if(IsInitialized() && width == width_ && height == height_ && fullscreen == fullscreen_ && borderless == borderless_ && resizable == resizable_ &&
         tripleBuffer == tripleBuffer_ && multiSample == multiSample_ && vsync != vsync_)
     {
         SDL_GL_SetSwapInterval(vsync ? 1 : 0);
@@ -254,21 +261,22 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool resizable, b
         return true;
     }
     
-    // If zero dimensions in windowed mode, set default. If zero in fullscreen, use desktop mode
+    // If zero dimensions in windowed mode, ignore well maximize. If zero in fullscreen, use desktop mod
     if (!width || !height)
     {
-        if (!fullscreen)
-        {
-            width = 1024;
-            height = 768;
-        }
-        else
+        if (fullscreen || borderless)
         {
             SDL_DisplayMode mode;
             SDL_GetDesktopDisplayMode(0, &mode);
             width = mode.w;
             height = mode.h;
         }
+        else
+        {
+            maximize = true;
+            width = 1024;
+            height = 768;
+        }
     }
     
     // Check fullscreen mode validity (desktop only). If not valid, revert to windowed
@@ -330,10 +338,12 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool resizable, b
         int y = fullscreen ? 0 : SDL_WINDOWPOS_UNDEFINED;
 
         unsigned flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN;
-        if (fullscreen)
-            flags |= SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS;
+        if(fullscreen)
+            flags |= SDL_WINDOW_FULLSCREEN;
         if (resizable)
             flags |= SDL_WINDOW_RESIZABLE;
+        if (borderless)
+            flags |= SDL_WINDOW_BORDERLESS;
         
         for (;;)
         {
@@ -366,6 +376,9 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool resizable, b
         }
 
         CreateWindowIcon();
+
+        if(maximize)
+            Maximize();
         
         // Create/restore context and GPU objects and set initial renderstate
         Restore();
@@ -435,6 +448,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool resizable, b
     
     fullscreen_ = fullscreen;
     resizable_ = resizable;
+    borderless_ = borderless;
     vsync_ = vsync;
     tripleBuffer_ = tripleBuffer;
     multiSample_ = multiSample;
@@ -453,6 +467,8 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool resizable, b
     #ifdef ENABLE_LOGGING
     String msg;
     msg.AppendWithFormat("Set screen mode %dx%d %s", width_, height_, (fullscreen_ ? "fullscreen" : "windowed"));
+    if (borderless_)
+        msg.Append(" borderless");
     if (resizable_)
         msg.Append(" resizable");
     if (multiSample > 1)
@@ -467,6 +483,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool resizable, b
     eventData[P_HEIGHT] = height_;
     eventData[P_FULLSCREEN] = fullscreen_;
     eventData[P_RESIZABLE] = resizable_;
+    eventData[P_BORDERLESS] = borderless_;
     SendEvent(E_SCREENMODE, eventData);
     
     return true;
@@ -474,7 +491,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool resizable, b
 
 bool Graphics::SetMode(int width, int height)
 {
-    return SetMode(width, height, fullscreen_, resizable_, vsync_, tripleBuffer_, multiSample_);
+    return SetMode(width, height, fullscreen_, borderless_, resizable_, vsync_, tripleBuffer_, multiSample_);
 }
 
 void Graphics::SetSRGB(bool enable)
@@ -490,7 +507,7 @@ void Graphics::SetSRGB(bool enable)
 
 bool Graphics::ToggleFullscreen()
 {
-    return SetMode(width_, height_, !fullscreen_, resizable_, vsync_, tripleBuffer_, multiSample_);
+    return SetMode(width_, height_, !fullscreen_, borderless_, resizable_, vsync_, tripleBuffer_, multiSample_);
 }
 
 void Graphics::Close()
@@ -2022,6 +2039,7 @@ void Graphics::WindowResized()
     eventData[P_HEIGHT] = height_;
     eventData[P_FULLSCREEN] = fullscreen_;
     eventData[P_RESIZABLE] = resizable_;
+    eventData[P_BORDERLESS] = borderless_;
     SendEvent(E_SCREENMODE, eventData);
 }
 
@@ -2193,6 +2211,22 @@ void Graphics::Restore()
         (*i)->OnDeviceReset();
 }
 
+void Graphics::Maximize()
+{
+    if (!impl_->window_)
+        return;
+
+    SDL_MaximizeWindow(impl_->window_);
+}
+
+void Graphics::Minimize()
+{
+    if (!impl_->window_)
+        return;
+
+    SDL_MinimizeWindow(impl_->window_);
+}
+
 void Graphics::CleanupRenderSurface(RenderSurface* surface)
 {
     if (!surface)

+ 10 - 2
Source/Engine/Graphics/OpenGL/OGLGraphics.h

@@ -95,7 +95,7 @@ public:
     /// Set window position.
     void SetWindowPosition(int x, int y);
     /// Set screen mode. Return true if successful.
-    bool SetMode(int width, int height, bool fullscreen, bool resizable, bool vsync, bool tripleBuffer, int multiSample);
+    bool SetMode(int width, int height, bool fullscreen, bool borderless, bool resizable, bool vsync, bool tripleBuffer, int multiSample);
     /// Set screen resolution only. Return true if successful.
     bool SetMode(int width, int height);
     /// Set whether the main window uses sRGB conversion on write.
@@ -239,7 +239,9 @@ public:
     int GetMultiSample() const { return multiSample_; }
     /// Return whether window is fullscreen.
     bool GetFullscreen() const { return fullscreen_; }
-    /// Return whether window is resizable.
+    /// Return whether window is borderless.
+    bool GetBorderless() const { return borderless_; }
+    /// Return whether window is resizable
     bool GetResizable() const { return resizable_; }
     /// Return whether vertical sync is on.
     bool GetVSync() const { return vsync_; }
@@ -374,6 +376,10 @@ public:
     void Release(bool clearGPUObjects, bool closeWindow);
     /// Restore GPU objects and reinitialize state. Requires an open window.
     void Restore();
+    /// Maximize the Window
+    void Maximize();
+    /// Minimize the Window
+    void Minimize();
     /// Clean up a render surface from all FBOs.
     void CleanupRenderSurface(RenderSurface* surface);
     /// Mark the FBO needing an update.
@@ -444,6 +450,8 @@ private:
     int multiSample_;
     /// Fullscreen flag.
     bool fullscreen_;
+    /// Borderless flag.
+    bool borderless_;
     /// Resizable flag.
     bool resizable_;
     /// Vertical sync flag.

+ 5 - 1
Source/Engine/LuaScript/pkgs/Graphics/Graphics.pkg

@@ -7,12 +7,14 @@ class Graphics : public Object
     void SetWindowPosition(const IntVector2& position);
     void SetWindowPosition(int x, int y);
 
-    bool SetMode(int width, int height, bool fullscreen, bool resizable, bool vsync, bool tripleBuffer, int multiSample);
+    bool SetMode(int width, int height, bool fullscreen, bool borderless, bool resizable, bool vsync, bool tripleBuffer, int multiSample);
     bool SetMode(int width, int height);
     
     void SetSRGB(bool enable);
     void SetFlushGPU(bool enable);
     bool ToggleFullscreen();
+	void Maximize();
+	void Minimize();
     void Close();
     bool TakeScreenShot(Image& destImage);
     
@@ -25,6 +27,7 @@ class Graphics : public Object
     int GetMultiSample() const;
     bool GetFullscreen() const;
     bool GetResizable() const;
+	bool GetBorderless() const;
     bool GetVSync() const;
     bool GetTripleBuffer() const;
     bool GetSRGB() const;
@@ -55,6 +58,7 @@ class Graphics : public Object
     tolua_readonly tolua_property__get_set int multiSample;
     tolua_readonly tolua_property__get_set bool fullscreen;
     tolua_readonly tolua_property__get_set bool resizable;
+	    tolua_readonly tolua_property__get_set bool borderless;
     tolua_readonly tolua_property__get_set bool vSync;
     tolua_readonly tolua_property__get_set bool tripleBuffer;
     tolua_property__get_set bool sRGB;

+ 4 - 1
Source/Engine/Script/GraphicsAPI.cpp

@@ -1187,10 +1187,12 @@ static Graphics* GetGraphics()
 static void RegisterGraphics(asIScriptEngine* engine)
 {
     RegisterObject<Graphics>(engine, "Graphics");
-    engine->RegisterObjectMethod("Graphics", "bool SetMode(int, int, bool, bool, bool, bool, int)", asMETHODPR(Graphics, SetMode, (int, int, bool, bool, bool, bool, int), bool), asCALL_THISCALL);
+    engine->RegisterObjectMethod("Graphics", "bool SetMode(int, int, bool, bool, bool, bool, bool, int)", asMETHODPR(Graphics, SetMode, (int, int, bool, bool, bool, bool, bool, int), bool), asCALL_THISCALL);
     engine->RegisterObjectMethod("Graphics", "bool SetMode(int, int)", asMETHODPR(Graphics, SetMode, (int, int), bool), asCALL_THISCALL);
     engine->RegisterObjectMethod("Graphics", "void SetWindowPosition(int, int)", asMETHODPR(Graphics, SetWindowPosition, (int, int), void), asCALL_THISCALL);
     engine->RegisterObjectMethod("Graphics", "bool ToggleFullscreen()", asMETHOD(Graphics, ToggleFullscreen), asCALL_THISCALL);
+    engine->RegisterObjectMethod("Graphics", "void Maximize()", asMETHOD(Graphics, Maximize), asCALL_THISCALL);
+    engine->RegisterObjectMethod("Graphics", "void Minimize()", asMETHOD(Graphics, Minimize), asCALL_THISCALL);
     engine->RegisterObjectMethod("Graphics", "void Close()", asMETHOD(Graphics, Close), asCALL_THISCALL);
     engine->RegisterObjectMethod("Graphics", "bool TakeScreenShot(Image@+)", asMETHOD(Graphics, TakeScreenShot), asCALL_THISCALL);
     engine->RegisterObjectMethod("Graphics", "void set_windowTitle(const String&in)", asMETHOD(Graphics, SetWindowTitle), asCALL_THISCALL);
@@ -1207,6 +1209,7 @@ static void RegisterGraphics(asIScriptEngine* engine)
     engine->RegisterObjectMethod("Graphics", "int get_multiSample() const", asMETHOD(Graphics, GetMultiSample), asCALL_THISCALL);
     engine->RegisterObjectMethod("Graphics", "bool get_fullscreen() const", asMETHOD(Graphics, GetFullscreen), asCALL_THISCALL);
     engine->RegisterObjectMethod("Graphics", "bool get_resizable() const", asMETHOD(Graphics, GetResizable), asCALL_THISCALL);
+    engine->RegisterObjectMethod("Graphics", "bool get_borderless() const", asMETHOD(Graphics, GetBorderless), asCALL_THISCALL);
     engine->RegisterObjectMethod("Graphics", "bool get_vsync() const", asMETHOD(Graphics, GetVSync), asCALL_THISCALL);
     engine->RegisterObjectMethod("Graphics", "bool get_tripleBuffer() const", asMETHOD(Graphics, GetTripleBuffer), asCALL_THISCALL);
     engine->RegisterObjectMethod("Graphics", "bool get_initialized() const", asMETHOD(Graphics, IsInitialized), asCALL_THISCALL);