supertux
Public Member Functions | List of all members
DrawingContext Class Referencefinal

This class provides functions for drawing things on screen. More...

#include <drawing_context.hpp>

Public Member Functions

 DrawingContext (VideoSystem &video_system, obstack &obst, bool overlay, float time_offset)
 
Rectf get_cliprect () const
 Returns the visible area in world coordinates.
 
Canvascolor ()
 
Canvaslight ()
 
Canvasget_canvas (DrawingTarget target)
 
void set_ambient_color (Color ambient_color)
 
Color get_ambient_color () const
 
void push_transform ()
 
void pop_transform ()
 
DrawingTransformtransform ()
 
const DrawingTransformtransform () const
 
const Vector & get_translation () const
 
void set_translation (const Vector &newtranslation)
 
float get_scale () const
 
void scale (float scale)
 
bool perspective_scale (float speed_x, float speed_y)
 Recalculates the scaling factor for parallax layers. More...
 
void set_flip (Flip flip)
 Apply that flip in the next draws (flips are listed on surface.h). More...
 
Flip get_flip () const
 
void set_alpha (float alpha)
 apply that alpha in the next draws (1.0 means fully opaque)
 
float get_alpha () const
 
void set_time_offset (float time_offset)
 For position extrapolation at high frame rates: real time since last game update step.
 
float get_time_offset () const
 
void clear ()
 
void set_viewport (const Rect &viewport)
 
const Rectget_viewport () const
 
float get_width () const
 
float get_height () const
 
Vector get_size () const
 
Rectf get_rect () const
 
bool use_lightmap () const
 
bool is_overlay () const
 

Detailed Description

This class provides functions for drawing things on screen.

It also maintains a stack of transforms that are applied to graphics.

Member Function Documentation

◆ perspective_scale()

bool DrawingContext::perspective_scale ( float  speed_x,
float  speed_y 
)

Recalculates the scaling factor for parallax layers.

◆ set_flip()

void DrawingContext::set_flip ( Flip  flip)

Apply that flip in the next draws (flips are listed on surface.h).


The documentation for this class was generated from the following files: