[AE Engine logo] Public API Reference
Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

ogl_renderer.h

00001 /*
00002  *  AE Engine
00003  *
00004  *  Copyright (C) 2003 Riku "Rakkis" Nurminen
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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__

AE Engine Public API Reference
Generated on Wed Apr 9 09:43:39 2003 by Doxygen.