Gel2D - The free/open source game creation suite

gelRenderSystem.h
Go to the documentation of this file.
00001 /*
00002 Gel2D Game Engine - Cross-platform 2D gaming middleware
00003 Copyright (C) 2011 Mark D. Procarione
00004 
00005 Gel2D is free software: you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation, either version 3 of the License, or
00008 (at your option) any later version.
00009 
00010 Gel2D is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013 GNU General Public License for more details.
00014 */
00015 
00016 #ifndef __GELRENDERSYSTEM_H__
00017 #define __GELRENDERSYSTEM_H__
00018 
00019 #include "gelViewport.h"
00020 #include "gelMatrix.h"
00021 
00022 namespace gel
00023 {
00024     class GelCamera;
00025 
00028 
00029     class GelRenderSystem
00030     {
00031         public:
00033             GelRenderSystem();
00034 
00036             virtual ~GelRenderSystem();
00037 
00039             RenderAPI getType() const { return type; }
00040 
00042 
00043             virtual void beginScene();
00044 
00046 
00047             virtual void endScene();
00048 
00050             virtual void setViewport( GelViewport vp );
00051 
00053             virtual GelViewport const getViewport() { return activeViewport; }
00054 
00056 
00058             virtual void updateViewport();
00059 
00060             virtual void setActiveCamera( GelCamera *cam ) { activeCamera = cam; }
00061 
00063             virtual void setClearColor( GelColor col );
00064 
00066 
00069             virtual void clearBuffers( bool color, bool depth, bool stencil );
00070 
00072 
00073                         virtual void drawArrays( int mode, int start, int count );
00074 
00075             virtual void transformView( const Gel3x3Matrix &mat );
00076             virtual void transformWorld( const Gel3x3Matrix &mat );
00077             virtual void transformModel( const Gel3x3Matrix &mat );
00078 
00080                         virtual Gel2dVec getWorldCoords( int x, int y );
00081 
00083 
00090                         virtual void takeScreenshot( const char *filename, ImageType ff, ColorMode cmode );
00091 
00092         protected:
00093             RenderAPI type;
00094             GelViewport activeViewport;
00095             GelCamera *activeCamera;
00096     };
00098 }
00099 
00100 #endif // __GELRENDERSYSTEM_H__