diff options
| author | Joe Ludwig <[email protected]> | 2013-07-17 18:26:59 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-07-17 18:26:59 -0700 |
| commit | e16ea21dc8a710237ade8413207f58d403c616a3 (patch) | |
| tree | 85dcfbda9881e4e022dedafefbc2727e2fd2aa59 /mp/src/public/togl/linuxwin/cglmfbo.h | |
| parent | Merge pull request #36 from AnAkIn1/fogplayerparams_fix (diff) | |
| download | source-sdk-2013-e16ea21dc8a710237ade8413207f58d403c616a3.tar.xz source-sdk-2013-e16ea21dc8a710237ade8413207f58d403c616a3.zip | |
* Added support for building shaders in your mod
* Added nav mesh support
* fixed many warnings and misc bugs
* Fixed the create*projects scripts in mp
* Added a bunch of stuff to .gitignore
Diffstat (limited to 'mp/src/public/togl/linuxwin/cglmfbo.h')
| -rw-r--r-- | mp/src/public/togl/linuxwin/cglmfbo.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/mp/src/public/togl/linuxwin/cglmfbo.h b/mp/src/public/togl/linuxwin/cglmfbo.h new file mode 100644 index 00000000..f3415795 --- /dev/null +++ b/mp/src/public/togl/linuxwin/cglmfbo.h @@ -0,0 +1,82 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// cglmfbo.h
+// GLMgr FBO's (render targets)
+//
+//===============================================================================
+
+#ifndef CGLMFBO_H
+#define CGLMFBO_H
+
+#pragma once
+
+// good FBO references / recaps
+// http://www.songho.ca/opengl/gl_fbo.html
+// http://www.gamedev.net/reference/articles/article2331.asp
+
+// ext links
+
+// http://www.opengl.org/registry/specs/EXT/framebuffer_object.txt
+// http://www.opengl.org/registry/specs/EXT/framebuffer_multisample.txt
+
+//===============================================================================
+
+// tokens not in the SDK headers
+
+#ifndef GL_DEPTH_STENCIL_ATTACHMENT_EXT
+ #define GL_DEPTH_STENCIL_ATTACHMENT_EXT 0x84F9
+#endif
+
+//===============================================================================
+
+// forward declarations
+
+class GLMContext;
+
+enum EGLMFBOAttachment
+{
+ kAttColor0, kAttColor1, kAttColor2, kAttColor3,
+ kAttDepth, kAttStencil, kAttDepthStencil,
+ kAttCount
+};
+
+struct GLMFBOTexAttachParams
+{
+ CGLMTex *m_tex;
+ int m_face; // keep zero if not cube map
+ int m_mip; // keep zero if notmip mapped
+ int m_zslice; // keep zero if not a 3D tex
+};
+
+class CGLMFBO
+{
+ friend class GLMContext;
+ friend class GLMTester;
+ friend class CGLMTex;
+
+ friend struct IDirect3D9;
+ friend struct IDirect3DDevice9;
+
+public:
+ CGLMFBO( GLMContext *ctx );
+ ~CGLMFBO( );
+
+protected:
+ void TexAttach( GLMFBOTexAttachParams *params, EGLMFBOAttachment attachIndex, GLenum fboBindPoint = GL_FRAMEBUFFER_EXT );
+ void TexDetach( EGLMFBOAttachment attachIndex, GLenum fboBindPoint = GL_FRAMEBUFFER_EXT );
+ // you can also pass GL_READ_FRAMEBUFFER_EXT or GL_DRAW_FRAMEBUFFER_EXT to selectively bind the receiving FBO to one or the other.
+
+ void TexScrub( CGLMTex *tex );
+ // search and destroy any attachment for the named texture
+
+ bool IsReady( void ); // aka FBO completeness check - ready to draw
+
+ GLMContext *m_ctx; // link back to parent context
+
+ GLuint m_name; // name of this FBO in the context
+
+ GLMFBOTexAttachParams m_attach[ kAttCount ]; // indexed by EGLMFBOAttachment
+};
+
+
+#endif
\ No newline at end of file |