Mercurial > fife-parpg
diff engine/core/video/sdl/renderbackendsdl.cpp @ 430:ad1f09d954f9
Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Tue, 23 Feb 2010 19:25:59 +0000 |
parents | ad7969d9460b |
children | b2feacaed53c |
line wrap: on
line diff
--- a/engine/core/video/sdl/renderbackendsdl.cpp Tue Feb 23 17:36:21 2010 +0000 +++ b/engine/core/video/sdl/renderbackendsdl.cpp Tue Feb 23 19:25:59 2010 +0000 @@ -51,7 +51,7 @@ static std::string backend_name = "SDL"; return backend_name; } - + void RenderBackendSDL::init() { if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) throw SDLException(SDL_GetError()); @@ -124,7 +124,7 @@ void RenderBackendSDL::endFrame() { SDL_Flip(m_screen->getSurface()); - } + } Image* RenderBackendSDL::createImage(SDL_Surface* surface) { return new SDLImage(surface); @@ -133,16 +133,21 @@ Image* RenderBackendSDL::createImage(const uint8_t* data, unsigned int width, unsigned int height) { return new SDLImage(data, width, height); } - + bool RenderBackendSDL::putPixel(int x, int y, int r, int g, int b) { return static_cast<SDLImage*>(m_screen)->putPixel(x, y, r, g, b); } - + void RenderBackendSDL::drawLine(const Point& p1, const Point& p2, int r, int g, int b) { static_cast<SDLImage*>(m_screen)->drawLine(p1, p2, r, g, b); } - + void RenderBackendSDL::drawQuad(const Point& p1, const Point& p2, const Point& p3, const Point& p4, int r, int g, int b) { static_cast<SDLImage*>(m_screen)->drawQuad(p1, p2, p3, p4, r, g, b); } -} + + void RenderBackendSDL::drawVertex(const Point& p, const uint8_t size, int r, int g, int b){ + static_cast<SDLImage*>(m_screen)->drawVertex(p, 2, r, g, b); + } + +}//FIFE