diff options
Diffstat (limited to 'Samples/CommonSrc/Render/Render_GL_Device.h')
-rw-r--r-- | Samples/CommonSrc/Render/Render_GL_Device.h | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/Samples/CommonSrc/Render/Render_GL_Device.h b/Samples/CommonSrc/Render/Render_GL_Device.h index 9b8ccef..0e24517 100644 --- a/Samples/CommonSrc/Render/Render_GL_Device.h +++ b/Samples/CommonSrc/Render/Render_GL_Device.h @@ -43,9 +43,9 @@ limitations under the License. #include <GL/glx.h> #endif - namespace OVR { namespace Render { namespace GL { - + + #if !defined(OVR_OS_MAC) // GL extension Hooks for PC. @@ -114,6 +114,44 @@ extern void InitGLExtensions(); #endif + + +//// GLVersion + +/* + FIXME: CODE DUPLICATION WARNING + + Right now we have this same code in CommonSrc and in CAPI::GL. + At some point we need to consolidate these, in Kernel or Util. + Be sure to update both locations for now! +*/ + +struct GLVersionAndExtensions +{ + // Version information + int MajorVersion; // Best guess at major version + int MinorVersion; // Best guess at minor version + bool IsGLES; // Open GL ES? + + // Extension information + bool SupportsVAO; // Supports Vertex Array Objects? + bool SupportsDrawBuffers; // Supports Draw Buffers? + const char* Extensions; // Other extensions string (will not be null) + + GLVersionAndExtensions() + { + IsGLES = false; + MajorVersion = 0; + MinorVersion = 0; + SupportsDrawBuffers = false; + SupportsVAO = false; + Extensions = ""; + } +}; + +void GetGLVersionAndExtensions(GLVersionAndExtensions& versionInfo); + + class RenderDevice; class Buffer : public Render::Buffer @@ -243,10 +281,10 @@ protected: Ptr<Texture> CurRenderTarget; Array<Ptr<Texture> > DepthBuffers; GLuint CurrentFbo; + GLVersionAndExtensions GLVersionInfo; const LightingParams* Lighting; - bool SupportsVao; - + public: RenderDevice(const RendererParams& p); virtual ~RenderDevice(); @@ -258,6 +296,7 @@ public: virtual void SetViewport(const Recti& vp); virtual void WaitUntilGpuIdle(); + virtual void Flush(); virtual void Clear(float r = 0, float g = 0, float b = 0, float a = 1, float depth = 1, bool clearColor = true, bool clearDepth = true); @@ -292,6 +331,7 @@ public: void SetTexture(Render::ShaderStage, int slot, const Texture* t); }; + }}} #endif |