22 #ifndef FIFE_VIDEO_RENDERBACKEND_H 23 #define FIFE_VIDEO_RENDERBACKEND_H 34 #include <SDL_video.h> 135 virtual const std::string& getName()
const = 0;
139 virtual void startFrame();
143 virtual void endFrame();
147 virtual void init(
const std::string& driver) = 0;
151 virtual void clearBackBuffer() = 0;
155 virtual void setLightingModel(
uint32_t lighting) = 0;
159 virtual uint32_t getLightingModel()
const = 0;
163 virtual void setLighting(
float red,
float green,
float blue) = 0;
167 virtual void resetLighting() = 0;
171 virtual void resetStencilBuffer(
uint8_t buffer) = 0;
175 virtual void changeBlending(int32_t scr, int32_t dst) = 0;
186 virtual void createMainScreen(
const ScreenMode& mode,
const std::string& title,
const std::string& icon) = 0;
191 virtual void setScreenMode(
const ScreenMode& mode) = 0;
210 virtual Image* createImage(SDL_Surface* surface) = 0;
211 virtual Image* createImage(
const std::string& name, SDL_Surface* surface) = 0;
215 virtual void renderVertexArrays() = 0;
227 virtual void captureScreen(
const std::string& filename) = 0;
231 virtual void captureScreen(
const std::string& filename,
uint32_t width,
uint32_t height) = 0;
238 const ScreenMode& getCurrentScreenMode()
const;
244 const Rect& getArea()
const;
250 void pushClipArea(
const Rect& cliparea,
bool clear=
true);
260 const Rect& getClipArea()
const;
322 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;
326 virtual void enableScissorTest() = 0;
330 virtual void disableScissorTest() = 0;
382 void setMipmappingEnabled(
bool enabled);
386 bool isMipmappingEnabled()
const;
390 int32_t getMaxAnisotropy()
const;
395 void setMonochromeEnabled(
bool enabled);
399 bool isMonochromeEnabled()
const;
404 void setDepthBufferEnabled(
bool enabled);
408 bool isDepthBufferEnabled()
const;
414 void setAlphaTestValue(
float alpha);
418 float getAlphaTestValue()
const;
422 void setColorKeyEnabled(
bool colorkeyenable);
426 bool isColorKeyEnabled()
const;
430 void setColorKey(
const SDL_Color& colorkey);
434 const SDL_Color& getColorKey()
const;
442 void resetBackgroundColor();
446 const SDL_PixelFormat& getPixelFormat()
const;
450 void setVSyncEnabled(
bool vsync);
454 bool isVSyncEnabled()
const;
458 void setFrameLimitEnabled(
bool limited);
462 bool isFrameLimitEnabled()
const;
466 void setFrameLimit(
uint16_t framelimit);
474 SDL_Surface* getScreenSurface();
478 SDL_Surface* getRenderTargetSurface();
482 virtual void attachRenderTarget(
ImagePtr& img,
bool discard) = 0;
486 virtual void detachRenderTarget() = 0;
490 virtual void renderGuiGeometry(
const std::vector<GuiVertex>& vertices,
const std::vector<int>& indices,
const DoublePoint& translation,
ImagePtr texture) = 0;
494 Point getBezierPoint(
const std::vector<Point>& points, int32_t elements,
float t);
498 void addControlPoints(
const std::vector<Point>& points, std::vector<Point>& newPoints);
505 virtual void setClipArea(
const Rect& cliparea,
bool clear) = 0;
540 void clearClipArea();
Abstract interface for all the renderbackends.
SDL_PixelFormat m_rgba_format
uint32_t getScreenWidth() const
void setFramebufferEnabled(bool enabled)
Enables or disable the usage of the framebuffer, if available.
uint32_t getScreenHeight() const
bool isImageCompressingEnabled() const
void setNPOTEnabled(bool enabled)
Enables or disable the usage of npot, if available.
bool isAlphaOptimizerEnabled() const
void setAlphaOptimizerEnabled(bool enabled)
Enable or disable the alpha 'optimizing' code.
SDL_Color m_backgroundcolor
TextureFiltering m_textureFilter
bool isNPOTEnabled() const
bool isFramebufferEnabled() const
std::stack< ClipInfo > m_clipstack
void setImageCompressingEnabled(bool enabled)
Enables or disable compressing images by video driver.