FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
Abstract interface for all the renderbackends. More...
#include <renderbackend.h>
Classes | |
class | ClipInfo |
Public Member Functions | |
RenderBackend (const SDL_Color &colorkey) | |
Constructor. More... | |
virtual | ~RenderBackend () |
Destructor. More... | |
virtual const std::string & | getName () const =0 |
The name of the renderbackend. More... | |
virtual void | startFrame () |
Called when a new frame starts. More... | |
virtual void | endFrame () |
Called when a frame is finished and ready to be displayed. More... | |
virtual void | init (const std::string &driver)=0 |
Initializes the backend. More... | |
virtual void | clearBackBuffer ()=0 |
Forces a clear of the backbuffer. More... | |
virtual void | setLightingModel (uint32_t lighting)=0 |
Initializes the light. More... | |
virtual uint32_t | getLightingModel () const =0 |
Gets the current light model. More... | |
virtual void | setLighting (float red, float green, float blue)=0 |
Set colors for lighting. More... | |
virtual void | resetLighting ()=0 |
Reset lighting with default values. More... | |
virtual void | resetStencilBuffer (uint8_t buffer)=0 |
Reset stencil buffer with given value. More... | |
virtual void | changeBlending (int32_t scr, int32_t dst)=0 |
Change the Blendingmodel. More... | |
void | deinit () |
Performs cleanup actions. More... | |
virtual void | createMainScreen (const ScreenMode &mode, const std::string &title, const std::string &icon)=0 |
Creates the mainscreen (the display window). More... | |
virtual void | setScreenMode (const ScreenMode &mode)=0 |
Sets the mainscreen display mode. More... | |
virtual Image * | createImage (IResourceLoader *loader=0)=0 |
virtual Image * | createImage (const std::string &name, IResourceLoader *loader=0)=0 |
virtual Image * | createImage (const uint8_t *data, uint32_t width, uint32_t height)=0 |
Creates an Image suitable for this renderbackend. More... | |
virtual Image * | createImage (const std::string &name, const uint8_t *data, uint32_t width, uint32_t height)=0 |
virtual Image * | createImage (SDL_Surface *surface)=0 |
Helper function to create images from SDL_Surfaces. More... | |
virtual Image * | createImage (const std::string &name, SDL_Surface *surface)=0 |
virtual void | renderVertexArrays ()=0 |
Render the Vertex Arrays, only for primitives (points, lines,...) More... | |
virtual void | addImageToArray (uint32_t id, const Rect &rec, float const *st, uint8_t alpha, uint8_t const *rgba)=0 |
Add the Image data to the array. More... | |
virtual void | changeRenderInfos (RenderDataType type, uint16_t elements, int32_t src, int32_t dst, bool light, bool stentest, uint8_t stenref, GLConstants stenop, GLConstants stenfunc, OverlayType otype=OVERLAY_TYPE_NONE)=0 |
Dirty helper function to change the render infos. More... | |
virtual void | captureScreen (const std::string &filename)=0 |
Creates a Screenshot and saves it to a file. More... | |
virtual void | captureScreen (const std::string &filename, uint32_t width, uint32_t height)=0 |
Creates a Screenshot with the given size(w,h) and saves it to a file. More... | |
SDL_Window * | getWindow () |
const ScreenMode & | getCurrentScreenMode () const |
Get current screen mode. More... | |
uint32_t | getWidth () const |
uint32_t | getHeight () const |
uint32_t | getScreenWidth () const |
uint32_t | getScreenHeight () const |
const Rect & | getArea () const |
void | pushClipArea (const Rect &cliparea, bool clear=true) |
Pushes clip area to clip stack Clip areas define which area is drawn on screen. More... | |
void | popClipArea () |
Pops clip area from clip stack. More... | |
const Rect & | getClipArea () const |
Gets the current clip area. More... | |
virtual bool | putPixel (int32_t x, int32_t y, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0 |
Writes pixel to given position. More... | |
virtual void | drawLine (const Point &p1, const Point &p2, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0 |
Draws line between given points with given RGBA. More... | |
virtual void | drawThickLine (const Point &p1, const Point &p2, uint8_t width, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0 |
Draws line between given points with given RGBA and width. More... | |
virtual void | drawPolyLine (const std::vector< Point > &points, uint8_t width, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0 |
Draws lines between given points with given RGBA and width. More... | |
virtual void | drawBezier (const std::vector< Point > &points, int32_t steps, uint8_t width, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0 |
Draws bezier curve between given points with given RGBA and width. More... | |
virtual void | drawTriangle (const Point &p1, const Point &p2, const Point &p3, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0 |
Draws triangle between given points with given RGBA. More... | |
virtual void | drawRectangle (const Point &p, uint16_t w, uint16_t h, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0 |
Draws an axis parallel rectangle. More... | |
virtual void | fillRectangle (const Point &p, uint16_t w, uint16_t h, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0 |
Draws a filled axis parallel rectangle. More... | |
virtual void | drawQuad (const Point &p1, const Point &p2, const Point &p3, const Point &p4, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0 |
Draws quad between given points with given RGBA. More... | |
virtual void | drawVertex (const Point &p, const uint8_t size, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0 |
Draws a quad that represents a vertex with given RGBA. More... | |
virtual void | drawCircle (const Point &p, uint32_t radius, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0 |
Draws a circle. More... | |
virtual void | drawFillCircle (const Point &p, uint32_t radius, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0 |
Draws a filled circle. More... | |
virtual void | drawCircleSegment (const Point &p, uint32_t radius, int32_t sangle, int32_t eangle, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0 |
Draws a circle segment. More... | |
virtual void | drawFillCircleSegment (const Point &p, uint32_t radius, int32_t sangle, int32_t eangle, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0 |
Draws a filled circle segment. More... | |
virtual void | drawLightPrimitive (const Point &p, uint8_t intensity, float radius, int32_t subdivisions, float xstretch, float ystretch, uint8_t red, uint8_t green, uint8_t blue)=0 |
Draws a light primitive that based on a triangle fan. More... | |
virtual void | enableScissorTest ()=0 |
Enables scissor test on the render backend. More... | |
virtual void | disableScissorTest ()=0 |
Disables scissor test on the render backend. More... | |
void | setAlphaOptimizerEnabled (bool enabled) |
Enable or disable the alpha 'optimizing' code. More... | |
bool | isAlphaOptimizerEnabled () const |
void | setImageCompressingEnabled (bool enabled) |
Enables or disable compressing images by video driver. More... | |
bool | isImageCompressingEnabled () const |
void | setFramebufferEnabled (bool enabled) |
Enables or disable the usage of the framebuffer, if available. More... | |
bool | isFramebufferEnabled () const |
void | setNPOTEnabled (bool enabled) |
Enables or disable the usage of npot, if available. More... | |
bool | isNPOTEnabled () const |
void | setTextureFiltering (TextureFiltering filter) |
Sets the texture filtering method. More... | |
TextureFiltering | getTextureFiltering () const |
void | setMipmappingEnabled (bool enabled) |
Enables or disables the usage of mipmapping. More... | |
bool | isMipmappingEnabled () const |
int32_t | getMaxAnisotropy () const |
Gets max antisotropy for antisotropic filtering. More... | |
void | setMonochromeEnabled (bool enabled) |
Enables or disables monochrome rendering. More... | |
bool | isMonochromeEnabled () const |
void | setDepthBufferEnabled (bool enabled) |
Enables or disables depth buffer rendering. More... | |
bool | isDepthBufferEnabled () const |
void | setAlphaTestValue (float alpha) |
Sets the value for alpha test. More... | |
float | getAlphaTestValue () const |
void | setColorKeyEnabled (bool colorkeyenable) |
Sets whether to use the colorkey feature. More... | |
bool | isColorKeyEnabled () const |
Gets whether the colorkey feature is in use. More... | |
void | setColorKey (const SDL_Color &colorkey) |
Sets the global colorkey to use for images. More... | |
const SDL_Color & | getColorKey () const |
Gets the global colorkey setting. More... | |
void | setBackgroundColor (uint8_t r, uint8_t g, uint8_t b) |
Set the background color. More... | |
void | resetBackgroundColor () |
Reset the background color to black. More... | |
const SDL_PixelFormat & | getPixelFormat () const |
Gets the current screen rgba format. More... | |
void | setVSyncEnabled (bool vsync) |
Sets whether to use VSync. More... | |
bool | isVSyncEnabled () const |
Gets whether VSync is in use. More... | |
void | setFrameLimitEnabled (bool limited) |
Sets whether to use the frame limiter. More... | |
bool | isFrameLimitEnabled () const |
Gets whether the frame limiter is in use. More... | |
void | setFrameLimit (uint16_t framelimit) |
Sets the frame limit. More... | |
uint16_t | getFrameLimit () const |
Gets the frame limit. More... | |
SDL_Surface * | getScreenSurface () |
Returns screen render surface. More... | |
SDL_Surface * | getRenderTargetSurface () |
Returns currently attached render surface. More... | |
virtual void | attachRenderTarget (ImagePtr &img, bool discard)=0 |
Attaches given image as a new render surface. More... | |
virtual void | detachRenderTarget ()=0 |
Detaches current render surface. More... | |
virtual void | renderGuiGeometry (const std::vector< GuiVertex > &vertices, const std::vector< int > &indices, const DoublePoint &translation, ImagePtr texture)=0 |
Renders geometry required by gui. More... | |
Point | getBezierPoint (const std::vector< Point > &points, int32_t elements, float t) |
Helper that returns an interpolated Point. More... | |
void | addControlPoints (const std::vector< Point > &points, std::vector< Point > &newPoints) |
Helper that adds the control points for bezier curves. More... | |
Public Member Functions inherited from FIFE::DynamicSingleton< RenderBackend > | |
DynamicSingleton () | |
virtual | ~DynamicSingleton () |
Protected Member Functions | |
virtual void | setClipArea (const Rect &cliparea, bool clear)=0 |
Sets given clip area into image. More... | |
void | clearClipArea () |
Clears any possible clip areas. More... | |
Protected Attributes | |
SDL_Window * | m_window |
SDL_Surface * | m_screen |
SDL_Surface * | m_target |
bool | m_compressimages |
bool | m_useframebuffer |
bool | m_usenpot |
bool | m_isalphaoptimized |
bool | m_iscolorkeyenabled |
SDL_Color | m_colorkey |
ScreenMode | m_screenMode |
SDL_PixelFormat | m_rgba_format |
bool | m_isbackgroundcolor |
SDL_Color | m_backgroundcolor |
bool | m_isMipmapping |
TextureFiltering | m_textureFilter |
int32_t | m_maxAnisotropy |
bool | m_monochrome |
bool | m_isDepthBuffer |
float | m_alphaValue |
bool | m_vSync |
std::stack< ClipInfo > | m_clipstack |
ClipInfo | m_guiClip |
Private Attributes | |
bool | m_isframelimit |
uint32_t | m_frame_start |
uint16_t | m_framelimit |
Additional Inherited Members | |
Static Public Member Functions inherited from FIFE::DynamicSingleton< RenderBackend > | |
static RenderBackend * | instance () |
Abstract interface for all the renderbackends.
Definition at line 121 of file renderbackend.h.
FIFE::RenderBackend::RenderBackend | ( | const SDL_Color & | colorkey | ) |
Constructor.
colorkey | The colorkey to use. |
Definition at line 34 of file renderbackend.cpp.
References m_backgroundcolor, and m_isbackgroundcolor.
|
virtual |
Destructor.
Definition at line 61 of file renderbackend.cpp.
void FIFE::RenderBackend::addControlPoints | ( | const std::vector< Point > & | points, |
std::vector< Point > & | newPoints | ||
) |
Helper that adds the control points for bezier curves.
Definition at line 284 of file renderbackend.cpp.
References FIFE::PointType2D< T >::x, and FIFE::PointType2D< T >::y.
|
pure virtual |
Add the Image data to the array.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::GLImage::render().
|
pure virtual |
Attaches given image as a new render surface.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::TargetRenderer::render(), and FIFE::Camera::renderStaticLayer().
|
pure virtual |
Creates a Screenshot and saves it to a file.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
|
pure virtual |
Creates a Screenshot with the given size(w,h) and saves it to a file.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
|
pure virtual |
Change the Blendingmodel.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
|
pure virtual |
Dirty helper function to change the render infos.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::GenericRendererLineInfo::render(), FIFE::GenericRendererPointInfo::render(), FIFE::FloatingTextRenderer::render(), FIFE::GenericRendererTriangleInfo::render(), FIFE::LightRendererImageInfo::render(), FIFE::GenericRendererQuadInfo::render(), FIFE::LightRendererAnimationInfo::render(), FIFE::GenericRendererVertexInfo::render(), FIFE::LightRendererSimpleLightInfo::render(), FIFE::LightRendererResizeInfo::render(), FIFE::GenericRendererTextInfo::render(), FIFE::InstanceRenderer::renderAlreadySorted(), FIFE::InstanceRenderer::renderOverlay(), and FIFE::InstanceRenderer::renderUnsorted().
|
pure virtual |
Forces a clear of the backbuffer.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Engine::pump().
|
protected |
Clears any possible clip areas.
Definition at line 131 of file renderbackend.cpp.
References getArea(), and setClipArea().
|
pure virtual |
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::InstanceRenderer::bindColoring(), FIFE::InstanceRenderer::bindMultiOutline(), FIFE::InstanceRenderer::bindOutline(), FIFE::ImageManager::create(), FIFE::LibRocketRenderInterface::GenerateTexture(), FIFE::FontBase::getAsImage(), FIFE::FontBase::getAsImageMultiline(), FIFE::InstanceRenderer::getMultiColorOverlay(), and FIFE::ImageManager::loadBlank().
|
pure virtual |
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
|
pure virtual |
Creates an Image suitable for this renderbackend.
data | Pointer to the imagedata (needs to be in RGBA, 8 bits per channel). |
width | Width of the image. |
height | Height of the image. |
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
|
pure virtual |
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
|
pure virtual |
Helper function to create images from SDL_Surfaces.
Takes ownership over the surface.
surface | The surface to convert. |
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
|
pure virtual |
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
|
pure virtual |
Creates the mainscreen (the display window).
mode | The ScreenMode to use. |
title | The window title to use. |
icon | The window icon to use. |
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Engine::changeScreenMode(), and FIFE::Engine::init().
void FIFE::RenderBackend::deinit | ( | ) |
Performs cleanup actions.
Definition at line 64 of file renderbackend.cpp.
Referenced by FIFE::RenderBackendOpenGL::~RenderBackendOpenGL(), and FIFE::RenderBackendSDL::~RenderBackendSDL().
|
pure virtual |
Detaches current render surface.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::TargetRenderer::render(), and FIFE::Camera::renderStaticLayer().
|
pure virtual |
Disables scissor test on the render backend.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::LibRocketRenderInterface::render().
|
pure virtual |
Draws bezier curve between given points with given RGBA and width.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::SdlGuiGraphics::drawBezier().
|
pure virtual |
Draws a circle.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::SdlGuiGraphics::drawCircle().
|
pure virtual |
Draws a circle segment.
Note: The start angle must be less than the end angle. 0 angle is right side.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::SdlGuiGraphics::drawCircleSegment().
|
pure virtual |
Draws a filled circle.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::SdlGuiGraphics::drawFillCircle().
|
pure virtual |
Draws a filled circle segment.
0 angle is right side. Note: The start angle must be less than the end angle.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::SdlGuiGraphics::drawFillCircleSegment().
|
pure virtual |
Draws a light primitive that based on a triangle fan.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::LightRendererSimpleLightInfo::render().
|
pure virtual |
Draws line between given points with given RGBA.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::SdlGuiGraphics::drawLine(), FIFE::OffRendererLineInfo::render(), FIFE::GenericRendererLineInfo::render(), FIFE::GridRenderer::render(), FIFE::CellSelectionRenderer::render(), FIFE::BlockingInfoRenderer::render(), FIFE::CellRenderer::render(), and FIFE::RenderVisitor::visit().
|
pure virtual |
Draws lines between given points with given RGBA and width.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::SdlGuiGraphics::drawPolyLine().
|
pure virtual |
Draws quad between given points with given RGBA.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::OffRendererQuadInfo::render(), and FIFE::GenericRendererQuadInfo::render().
|
pure virtual |
Draws an axis parallel rectangle.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::SdlGuiGraphics::drawRectangle(), and FIFE::FloatingTextRenderer::render().
|
pure virtual |
Draws line between given points with given RGBA and width.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::SdlGuiGraphics::drawLine().
|
pure virtual |
Draws triangle between given points with given RGBA.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::OffRendererTriangleInfo::render(), and FIFE::GenericRendererTriangleInfo::render().
|
pure virtual |
Draws a quad that represents a vertex with given RGBA.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::OffRendererVertexInfo::render(), and FIFE::GenericRendererVertexInfo::render().
|
pure virtual |
Enables scissor test on the render backend.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::LibRocketRenderInterface::render().
|
virtual |
Called when a frame is finished and ready to be displayed.
Reimplemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Definition at line 75 of file renderbackend.cpp.
References m_frame_start, m_framelimit, and m_isframelimit.
Referenced by FIFE::RenderBackendOpenGL::endFrame(), FIFE::RenderBackendSDL::endFrame(), and FIFE::Engine::pump().
|
pure virtual |
Draws a filled axis parallel rectangle.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::SdlGuiGraphics::fillRectangle(), FIFE::FloatingTextRenderer::render(), and FIFE::Camera::renderOverlay().
float FIFE::RenderBackend::getAlphaTestValue | ( | ) | const |
const Rect & FIFE::RenderBackend::getArea | ( | ) | const |
Definition at line 97 of file renderbackend.cpp.
References m_screen.
Referenced by clearClipArea(), getClipArea(), popClipArea(), and FIFE::EventManager::processMouseEvent().
Point FIFE::RenderBackend::getBezierPoint | ( | const std::vector< Point > & | points, |
int32_t | elements, | ||
float | t | ||
) |
Helper that returns an interpolated Point.
Definition at line 244 of file renderbackend.cpp.
References FIFE::Math< T >::Pow().
Referenced by FIFE::RenderBackendSDL::drawBezier(), and FIFE::RenderBackendOpenGL::drawBezier().
const Rect & FIFE::RenderBackend::getClipArea | ( | ) | const |
Gets the current clip area.
Definition at line 123 of file renderbackend.cpp.
References getArea(), and m_clipstack.
const SDL_Color & FIFE::RenderBackend::getColorKey | ( | ) | const |
Gets the global colorkey setting.
Definition at line 191 of file renderbackend.cpp.
References m_colorkey.
Referenced by FIFE::GLImage::resetGlimage(), FIFE::SDLImage::resetSdlimage(), and FIFE::SubImageFont::SubImageFont().
const ScreenMode & FIFE::RenderBackend::getCurrentScreenMode | ( | ) | const |
Get current screen mode.
Definition at line 85 of file renderbackend.cpp.
References m_screenMode.
uint16_t FIFE::RenderBackend::getFrameLimit | ( | ) | const |
uint32_t FIFE::RenderBackend::getHeight | ( | ) | const |
Definition at line 93 of file renderbackend.cpp.
References m_screen.
Referenced by FIFE::RenderBackendSDL::captureScreen(), FIFE::RenderBackendOpenGL::captureScreen(), FIFE::OpenGLGuiGraphics::OpenGLGuiGraphics(), FIFE::FloatingTextRenderer::render(), FIFE::Camera::renderStaticLayer(), FIFE::RenderBackendOpenGL::setClipArea(), and FIFE::OpenGLGuiGraphics::updateTarget().
|
pure virtual |
Gets the current light model.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::GenericRendererLineInfo::render(), FIFE::GenericRendererPointInfo::render(), FIFE::FloatingTextRenderer::render(), FIFE::GenericRendererTriangleInfo::render(), FIFE::LightRendererImageInfo::render(), FIFE::GenericRendererQuadInfo::render(), FIFE::LightRendererAnimationInfo::render(), FIFE::GenericRendererVertexInfo::render(), FIFE::LightRendererSimpleLightInfo::render(), FIFE::LightRendererResizeInfo::render(), FIFE::GenericRendererTextInfo::render(), FIFE::LightRenderer::render(), FIFE::Camera::render(), FIFE::InstanceRenderer::renderAlreadySorted(), and FIFE::InstanceRenderer::renderUnsorted().
int32_t FIFE::RenderBackend::getMaxAnisotropy | ( | ) | const |
Gets max antisotropy for antisotropic filtering.
Definition at line 151 of file renderbackend.cpp.
References m_maxAnisotropy.
|
pure virtual |
The name of the renderbackend.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::InstanceRenderer::InstanceRenderer(), FIFE::ImageLoader::load(), and FIFE::Camera::renderStaticLayer().
const SDL_PixelFormat & FIFE::RenderBackend::getPixelFormat | ( | ) | const |
Gets the current screen rgba format.
Definition at line 208 of file renderbackend.cpp.
References m_rgba_format.
Referenced by FIFE::GLImage::generateGLTexture(), and FIFE::ImageLoader::load().
SDL_Surface * FIFE::RenderBackend::getRenderTargetSurface | ( | ) |
Returns currently attached render surface.
Definition at line 240 of file renderbackend.cpp.
References m_target.
Referenced by FIFE::GLImage::generateGLTexture(), FIFE::SDLImage::render(), FIFE::GLImage::render(), and FIFE::GLImage::renderZ().
|
inline |
Definition at line 243 of file renderbackend.h.
Referenced by FIFE::MapLoader::load(), and FIFE::Console::reLayout().
SDL_Surface * FIFE::RenderBackend::getScreenSurface | ( | ) |
Returns screen render surface.
Definition at line 236 of file renderbackend.cpp.
References m_screen.
Referenced by FIFE::SdlGuiGraphics::SdlGuiGraphics(), and FIFE::SdlGuiGraphics::updateTarget().
|
inline |
Definition at line 242 of file renderbackend.h.
Referenced by FIFE::MapLoader::load(), and FIFE::Console::reLayout().
TextureFiltering FIFE::RenderBackend::getTextureFiltering | ( | ) | const |
Definition at line 139 of file renderbackend.cpp.
References m_textureFilter.
uint32_t FIFE::RenderBackend::getWidth | ( | ) | const |
Definition at line 89 of file renderbackend.cpp.
References m_screen.
Referenced by FIFE::RenderBackendSDL::captureScreen(), FIFE::RenderBackendOpenGL::captureScreen(), FIFE::OpenGLGuiGraphics::OpenGLGuiGraphics(), FIFE::FloatingTextRenderer::render(), and FIFE::OpenGLGuiGraphics::updateTarget().
|
inline |
Definition at line 233 of file renderbackend.h.
|
pure virtual |
Initializes the backend.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Engine::init().
|
inline |
Definition at line 341 of file renderbackend.h.
bool FIFE::RenderBackend::isColorKeyEnabled | ( | ) | const |
Gets whether the colorkey feature is in use.
Definition at line 183 of file renderbackend.cpp.
References m_iscolorkeyenabled.
Referenced by FIFE::GLImage::generateGLTexture().
bool FIFE::RenderBackend::isDepthBufferEnabled | ( | ) | const |
Definition at line 167 of file renderbackend.cpp.
References m_isDepthBuffer.
Referenced by FIFE::InstanceRenderer::InstanceRenderer().
|
inline |
Definition at line 358 of file renderbackend.h.
bool FIFE::RenderBackend::isFrameLimitEnabled | ( | ) | const |
Gets whether the frame limiter is in use.
Definition at line 224 of file renderbackend.cpp.
References m_isframelimit.
|
inline |
Definition at line 350 of file renderbackend.h.
Referenced by FIFE::GuiImageLoader::load().
bool FIFE::RenderBackend::isMipmappingEnabled | ( | ) | const |
Definition at line 147 of file renderbackend.cpp.
References m_isMipmapping.
Referenced by FIFE::GLImage::generateGLTexture().
bool FIFE::RenderBackend::isMonochromeEnabled | ( | ) | const |
Definition at line 159 of file renderbackend.cpp.
References m_monochrome.
Referenced by FIFE::GLImage::generateGLTexture().
|
inline |
Definition at line 366 of file renderbackend.h.
bool FIFE::RenderBackend::isVSyncEnabled | ( | ) | const |
void FIFE::RenderBackend::popClipArea | ( | ) |
Pops clip area from clip stack.
Definition at line 110 of file renderbackend.cpp.
References getArea(), m_clipstack, FIFE::RenderBackend::ClipInfo::r, and setClipArea().
Referenced by FIFE::OpenGLGuiGraphics::_endDraw(), FIFE::SdlGuiGraphics::_endDraw(), FIFE::Cursor::draw(), FIFE::OpenGLGuiGraphics::popClipArea(), FIFE::SdlGuiGraphics::popClipArea(), FIFE::LibRocketRenderInterface::render(), FIFE::OffRenderer::render(), FIFE::Camera::render(), and FIFE::Camera::renderStaticLayer().
void FIFE::RenderBackend::pushClipArea | ( | const Rect & | cliparea, |
bool | clear = true |
||
) |
Pushes clip area to clip stack Clip areas define which area is drawn on screen.
Usable e.g. with viewports note that previous items in stack do not affect the latest area pushed
Definition at line 102 of file renderbackend.cpp.
References FIFE::RenderBackend::ClipInfo::clearing, m_clipstack, FIFE::RenderBackend::ClipInfo::r, and setClipArea().
Referenced by FIFE::OpenGLGuiGraphics::_beginDraw(), FIFE::SdlGuiGraphics::_beginDraw(), FIFE::Cursor::draw(), FIFE::OpenGLGuiGraphics::pushClipArea(), FIFE::SdlGuiGraphics::pushClipArea(), FIFE::LibRocketRenderInterface::render(), FIFE::OffRenderer::render(), FIFE::Camera::render(), and FIFE::Camera::renderStaticLayer().
|
pure virtual |
Writes pixel to given position.
Returns true, if pixel was written (not out of bounds)
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::SdlGuiGraphics::drawPoint(), FIFE::OffRendererPointInfo::render(), and FIFE::GenericRendererPointInfo::render().
|
pure virtual |
Renders geometry required by gui.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::LibRocketRenderInterface::render().
|
pure virtual |
Render the Vertex Arrays, only for primitives (points, lines,...)
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Cursor::draw(), FIFE::OffRenderer::render(), FIFE::Camera::render(), and FIFE::Camera::renderStaticLayer().
void FIFE::RenderBackend::resetBackgroundColor | ( | ) |
Reset the background color to black.
Definition at line 204 of file renderbackend.cpp.
References setBackgroundColor().
|
pure virtual |
Reset lighting with default values.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Camera::render(), and FIFE::Camera::resetLightingColor().
|
pure virtual |
Reset stencil buffer with given value.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Camera::render().
|
inline |
Enable or disable the alpha 'optimizing' code.
enabled | Optimize whether the image shall be analysed for 'fake' alpha images. Only implemented by and useful for the SDL backend at the moment. |
Definition at line 337 of file renderbackend.h.
void FIFE::RenderBackend::setAlphaTestValue | ( | float | alpha | ) |
Sets the value for alpha test.
Discards a fragment if its value is not greater. Only used if depth buffer is enabled. Note! Works only for OpenGL backend.
Definition at line 171 of file renderbackend.cpp.
References m_alphaValue.
Referenced by FIFE::Engine::init().
void FIFE::RenderBackend::setBackgroundColor | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b | ||
) |
Set the background color.
Definition at line 195 of file renderbackend.cpp.
References m_backgroundcolor, and m_isbackgroundcolor.
Referenced by resetBackgroundColor().
|
protectedpure virtual |
Sets given clip area into image.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by clearClipArea(), popClipArea(), and pushClipArea().
void FIFE::RenderBackend::setColorKey | ( | const SDL_Color & | colorkey | ) |
Sets the global colorkey to use for images.
Definition at line 187 of file renderbackend.cpp.
References m_colorkey.
void FIFE::RenderBackend::setColorKeyEnabled | ( | bool | colorkeyenable | ) |
Sets whether to use the colorkey feature.
Definition at line 179 of file renderbackend.cpp.
References m_iscolorkeyenabled.
Referenced by FIFE::Engine::init().
void FIFE::RenderBackend::setDepthBufferEnabled | ( | bool | enabled | ) |
Enables or disables depth buffer rendering.
Note! Works only for OpenGL backend.
Definition at line 163 of file renderbackend.cpp.
References m_isDepthBuffer.
Referenced by FIFE::Engine::init().
|
inline |
Enables or disable the usage of the framebuffer, if available.
Definition at line 354 of file renderbackend.h.
Referenced by FIFE::Engine::init().
void FIFE::RenderBackend::setFrameLimit | ( | uint16_t | framelimit | ) |
Sets the frame limit.
Definition at line 228 of file renderbackend.cpp.
References m_framelimit.
Referenced by FIFE::Engine::init().
void FIFE::RenderBackend::setFrameLimitEnabled | ( | bool | limited | ) |
Sets whether to use the frame limiter.
Definition at line 220 of file renderbackend.cpp.
References m_isframelimit.
Referenced by FIFE::Engine::init().
|
inline |
Enables or disable compressing images by video driver.
Definition at line 346 of file renderbackend.h.
Referenced by FIFE::Engine::init(), and FIFE::GuiImageLoader::load().
|
pure virtual |
Set colors for lighting.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Camera::render().
|
pure virtual |
Initializes the light.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Engine::init().
void FIFE::RenderBackend::setMipmappingEnabled | ( | bool | enabled | ) |
Enables or disables the usage of mipmapping.
Note! Works only for OpenGL backends.
Definition at line 143 of file renderbackend.cpp.
References m_isMipmapping.
Referenced by FIFE::Engine::init().
void FIFE::RenderBackend::setMonochromeEnabled | ( | bool | enabled | ) |
Enables or disables monochrome rendering.
Note! Works only for OpenGL backends.
Definition at line 155 of file renderbackend.cpp.
References m_monochrome.
Referenced by FIFE::Engine::init().
|
inline |
Enables or disable the usage of npot, if available.
Definition at line 362 of file renderbackend.h.
Referenced by FIFE::Engine::init().
|
pure virtual |
Sets the mainscreen display mode.
mode | The ScreenMode to change the display to. |
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
void FIFE::RenderBackend::setTextureFiltering | ( | TextureFiltering | filter | ) |
Sets the texture filtering method.
Supports none, bilinear, trilinear and anisotropic filtering. Note! Works only for OpenGL backends.
Definition at line 135 of file renderbackend.cpp.
References m_textureFilter.
Referenced by FIFE::Engine::init().
void FIFE::RenderBackend::setVSyncEnabled | ( | bool | vsync | ) |
Sets whether to use VSync.
Definition at line 212 of file renderbackend.cpp.
References m_vSync.
Referenced by FIFE::Engine::init().
|
virtual |
Called when a new frame starts.
Reimplemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Definition at line 69 of file renderbackend.cpp.
References m_frame_start, and m_isframelimit.
Referenced by FIFE::Engine::pump(), FIFE::RenderBackendSDL::startFrame(), and FIFE::RenderBackendOpenGL::startFrame().
|
protected |
Definition at line 533 of file renderbackend.h.
Referenced by getAlphaTestValue(), FIFE::RenderBackendOpenGL::renderWithColorAndZ(), setAlphaTestValue(), and FIFE::RenderBackendOpenGL::setScreenMode().
|
protected |
Definition at line 520 of file renderbackend.h.
Referenced by RenderBackend(), setBackgroundColor(), FIFE::RenderBackendSDL::setClipArea(), and FIFE::RenderBackendOpenGL::setClipArea().
|
protected |
Definition at line 547 of file renderbackend.h.
Referenced by getClipArea(), popClipArea(), and pushClipArea().
|
protected |
Definition at line 515 of file renderbackend.h.
Referenced by getColorKey(), and setColorKey().
|
protected |
Definition at line 510 of file renderbackend.h.
|
private |
Definition at line 552 of file renderbackend.h.
Referenced by endFrame(), and startFrame().
|
private |
Definition at line 553 of file renderbackend.h.
Referenced by endFrame(), getFrameLimit(), and setFrameLimit().
|
protected |
Definition at line 549 of file renderbackend.h.
|
protected |
Definition at line 513 of file renderbackend.h.
|
protected |
Definition at line 519 of file renderbackend.h.
Referenced by RenderBackend(), setBackgroundColor(), FIFE::RenderBackendSDL::setClipArea(), and FIFE::RenderBackendOpenGL::setClipArea().
|
protected |
Definition at line 514 of file renderbackend.h.
Referenced by isColorKeyEnabled(), and setColorKeyEnabled().
|
protected |
Definition at line 531 of file renderbackend.h.
Referenced by isDepthBufferEnabled(), and setDepthBufferEnabled().
|
private |
Definition at line 551 of file renderbackend.h.
Referenced by endFrame(), isFrameLimitEnabled(), setFrameLimitEnabled(), and startFrame().
|
protected |
Definition at line 523 of file renderbackend.h.
Referenced by isMipmappingEnabled(), and setMipmappingEnabled().
|
protected |
Definition at line 527 of file renderbackend.h.
Referenced by getMaxAnisotropy(), and FIFE::RenderBackendOpenGL::setScreenMode().
|
protected |
Definition at line 529 of file renderbackend.h.
Referenced by isMonochromeEnabled(), and setMonochromeEnabled().
|
protected |
Definition at line 517 of file renderbackend.h.
Referenced by FIFE::RenderBackendSDL::attachRenderTarget(), FIFE::RenderBackendOpenGL::createImage(), getPixelFormat(), FIFE::RenderBackendSDL::setScreenMode(), and FIFE::RenderBackendOpenGL::setScreenMode().
|
protected |
Definition at line 508 of file renderbackend.h.
Referenced by FIFE::RenderBackendSDL::captureScreen(), FIFE::RenderBackendSDL::detachRenderTarget(), FIFE::RenderBackendOpenGL::detachRenderTarget(), getArea(), getHeight(), getScreenSurface(), getWidth(), FIFE::RenderBackendSDL::setScreenMode(), and FIFE::RenderBackendOpenGL::setScreenMode().
|
protected |
Definition at line 516 of file renderbackend.h.
Referenced by getCurrentScreenMode(), FIFE::RenderBackendSDL::setScreenMode(), and FIFE::RenderBackendOpenGL::setScreenMode().
|
protected |
Definition at line 509 of file renderbackend.h.
Referenced by FIFE::RenderBackendSDL::attachRenderTarget(), FIFE::RenderBackendOpenGL::attachRenderTarget(), FIFE::RenderBackendSDL::detachRenderTarget(), FIFE::RenderBackendOpenGL::detachRenderTarget(), getRenderTargetSurface(), FIFE::RenderBackendOpenGL::putPixel(), FIFE::RenderBackendOpenGL::setScreenMode(), and FIFE::RenderBackendSDL::setScreenMode().
|
protected |
Definition at line 525 of file renderbackend.h.
Referenced by getTextureFiltering(), FIFE::RenderBackendSDL::setScreenMode(), FIFE::RenderBackendOpenGL::setScreenMode(), and setTextureFiltering().
|
protected |
Definition at line 511 of file renderbackend.h.
Referenced by FIFE::RenderBackendOpenGL::attachRenderTarget(), FIFE::RenderBackendOpenGL::detachRenderTarget(), FIFE::RenderBackendOpenGL::setScreenMode(), and FIFE::RenderBackendOpenGL::~RenderBackendOpenGL().
|
protected |
Definition at line 512 of file renderbackend.h.
|
protected |
Definition at line 535 of file renderbackend.h.
Referenced by isVSyncEnabled(), FIFE::RenderBackendSDL::setScreenMode(), FIFE::RenderBackendOpenGL::setScreenMode(), and setVSyncEnabled().
|
protected |
Definition at line 507 of file renderbackend.h.
Referenced by FIFE::RenderBackendOpenGL::createMainScreen(), FIFE::RenderBackendSDL::createMainScreen(), FIFE::RenderBackendOpenGL::endFrame(), FIFE::RenderBackendOpenGL::setScreenMode(), FIFE::RenderBackendSDL::setScreenMode(), FIFE::RenderBackendOpenGL::~RenderBackendOpenGL(), and FIFE::RenderBackendSDL::~RenderBackendSDL().