12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #include "GraphicsApi.h"
- #include "Fenster.h"
- #include "Bild.h"
- using namespace Framework;
- GraphicsApi::GraphicsApi( GraphicApiType typ )
- {
- this->typ = typ;
- fenster = 0;
- backBufferSize = Vec2<int>( 0, 0 );
- fullScreen = 0;
- ref = 1;
- }
- GraphicsApi::~GraphicsApi()
- {
- if( fenster )
- fenster->release();
- }
- void GraphicsApi::initialize( WFenster * fenster, Vec2<int> backBufferSize, bool fullScreen )
- {
- if( this->fenster )
- this->fenster->release();
- this->fenster = fenster;
- if( !backBufferSize.x || !backBufferSize.y )
- backBufferSize = fenster ? fenster->getKörperGröße() : Punkt( 0, 0 );
- this->backBufferSize = backBufferSize;
- this->fullScreen = fullScreen;
- }
- void GraphicsApi::setBackBufferSize( Vec2< int > size )
- {
- backBufferSize = size;
- update();
- }
- void GraphicsApi::setFullScreen( bool fullScreen )
- {
- this->fullScreen = fullScreen;
- update();
- }
- void GraphicsApi::beginFrame( bool fill2D, bool fill3D, int fillColor )
- {}
- void GraphicsApi::renderKamera( Kam3D * zKamera )
- {}
- Textur *GraphicsApi::createOrGetTextur( const char *name, Bild * b )
- {
- if( b )
- b->release();
- return 0;
- }
- GraphicApiType GraphicsApi::getTyp() const
- {
- return typ;
- }
- Vec2< int > GraphicsApi::getBackBufferSize() const
- {
- return backBufferSize;
- }
- bool GraphicsApi::isFullScreen() const
- {
- return fullScreen;
- }
- GraphicsApi *GraphicsApi::getThis()
- {
- ref++;
- return this;
- }
- GraphicsApi *GraphicsApi::release()
- {
- if( !--ref )
- delete this;
- return 0;
- }
|