00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __AEPLUGIN_AERENDERER_OGL_RENDERER_H__
00023 #define __AEPLUGIN_AERENDERER_OGL_RENDERER_H__
00024
00025 #include <aedefs.h>
00026 #include <aegeom/matrix4.h>
00027 #include <aegeom/vector3.h>
00028 #include <aegfx/color4.h>
00029 #include <aereg/base.h>
00030 #include <aereg/registry.h>
00031 #include <aerenderer/renderer.h>
00032 #include <aerenderer/rendereroptions.h>
00033 #include <aerenderer/renderertypes.h>
00034 #include <aerenderer/renderop.h>
00035 #include <aesys/system.h>
00036
00043 class aeOpenGLRenderer: public aeRenderer {
00044 private:
00052 aeDepthBufferFunc convertOpenGLDepthBufferFunc2AE(GLint depthFunc) const;
00053
00061 GLint convertaeDepthBufferFunc2OpenGL(aeDepthBufferFunc depthFunc) const;
00062
00063 public:
00073 aeOpenGLRenderer(aeRegistry *reg, bool fullscreen, int winWidth, int winHeight, int winBpp);
00074 ~aeOpenGLRenderer();
00075
00081 void initialize();
00082
00089 void reinitialize();
00090
00094 void shutdown();
00095
00101 bool createWindow();
00102
00106 void closeWindow();
00107
00118 void setOptions(aeRendererOptions &ropts, bool reinitialize = false);
00119
00126 void setShadeMode(aeShadeMode sm);
00127
00135 aeShadeMode getShadeMode() const;
00136
00144 void addViewport(aeViewport *vp, bool becomesActive = false);
00145
00151 void removeViewport(const char *vpName);
00152
00156 void removeAllViewports();
00157
00165 aeViewport findViewportByName(const char *vpName) const;
00166
00173 aeViewport getActiveViewport() const;
00174
00180 void _flushPipeline();
00181
00187 void _setActiveTextureUnit(int texUnit);
00188
00194 int _getActiveTextureUnit() const;
00195
00207 void _setTextureParams(aeRendererUnit targetTex, aeTextureFilterMode tfMode,
00208 aeTextureEnvironment texEnv);
00209
00218 void _setTextureFilter(aeRendererUnit targetTex, aeTextureFilterMode tfMode);
00219
00229 aeTextureFilterMode _getTextureFilter(aeRenderUnit targetTex) const;
00230
00238 void _setTextureEnvironment(aeTextureEnvironment texEnv);
00239
00247 aeTextureEnvironment _getTextureEnvironment() const;
00248
00257 void _setDepthBufferParams(bool depthTest, bool depthWrite,
00258 aeDepthBufferFunc depthFunc);
00259
00265 void _setDepthBufferTest(bool depthTest);
00266
00272 bool _getDepthBufferTest() const;
00273
00279 void _setDepthBufferWrite(bool depthWrite);
00280
00286 bool _getDepthBufferWrite() const;
00287
00293 void _setDepthBufferFunction(aeDepthBufferFunc depthFunc);
00294
00300 aeDepthBufferFunc _getDepthBufferFunction() const;
00301
00310 void _setBlendFunction(aeBlendFunc src, aeBlendFunc dest);
00311
00317 void _setWorldMatrix(const aeMatrix4 &worldMat);
00318
00324 void _setViewMatrix(const aeMatrix4 &viewMat);
00325
00331 void _setProjectionMatrix(const aeMatrix4 &projMat);
00332
00338 void _pushWorldMatrix();
00339
00345 void _pushViewMatrix();
00346
00352 void _pushProjectionMatrix();
00353
00358 void _popWorldMatrix();
00359
00364 void _popViewMatrix();
00365
00370 void _popProjectionMatrix();
00371
00376 void _prepareFrame();
00377
00389 void _render(aeRenderOperation &renderOp);
00390
00395 void _finishFrame();
00396 };
00397
00398 #endif // __AEPLUGIN_AERENDERER_OGL_RENDERER_H__