Adonthell  0.4
screen Class Reference

Screen access is made through this class. More...

#include <screen.h>

Collaboration diagram for screen:

Static Public Member Functions

static void cleanup ()
 
static SDL_Renderer * get_renderer ()
 
static u_int32 format ()
 
static bool init (u_int16 nl, u_int16 nh, u_int8 depth, const config &myconfig)
 Initializes the video subsystem and creates the required resources. More...
 
static u_int16 length ()
 Returns the length of the screen. More...
 
static u_int16 height ()
 Returns the height of the screen. More...
 
static u_int8 bytes_per_pixel ()
 Returns the screen depth, in bytes per pixel. More...
 
static u_int32 trans_col ()
 Returns the translucent color in screen's depth format. More...
 
static u_int8 scale ()
 Scale factor of the screen. More...
 
static u_int16 offset_x ()
 X offset of the viewport. More...
 
static u_int16 offset_y ()
 Y offset of the viewport. More...
 
static void clear ()
 Totally clears the screen with black. More...
 
static void show ()
 Ensure the framebuffer is copied to the physical screen. More...
 
static u_int8 mode ()
 Returns whether the current mode is fullscreen or windowed. More...
 
static bool set_fullscreen (const u_int8 &m)
 Sets fullscreen/windowed mode. More...
 
static string info ()
 Returns information about the current screen settings, suitable for being displayed to the user. More...
 
static void transition (u_int16 i)
 Make a nice transition effect. More...
 

Static Public Attributes

static surface display
 The actual screen surface. More...
 

Detailed Description

Screen access is made through this class.

This static class sets video modes, flush the frame buffer to the physical screen and make abstraction of the real screen depth to ease the graphic programmer's task.

Definition at line 48 of file screen.h.

Member Function Documentation

§ init()

bool screen::init ( u_int16  nl,
u_int16  nh,
u_int8  depth,
const config myconfig 
)
static

Initializes the video subsystem and creates the required resources.

Parameters
nlX screen resolution.
nhY screen resolution.
depthdesired screen depth.
myconfigconfiguration data.
Returns
true on success, false otherwise.

Definition at line 65 of file screen.cc.

§ length()

static u_int16 screen::length ( )
inlinestatic

Returns the length of the screen.

Returns
length of the screen.

Definition at line 84 of file screen.h.

§ height()

static u_int16 screen::height ( )
inlinestatic

Returns the height of the screen.

Returns
height of the screen.

Definition at line 92 of file screen.h.

§ bytes_per_pixel()

static u_int8 screen::bytes_per_pixel ( )
inlinestatic

Returns the screen depth, in bytes per pixel.

Returns
screen depth, in bytes per pixel.

Definition at line 100 of file screen.h.

§ trans_col()

static u_int32 screen::trans_col ( )
inlinestatic

Returns the translucent color in screen's depth format.

For manipulation on images that will only be displayed, this is the right function to call for getting the translucent color.

Returns
the translucent color in screen's depth format.

Definition at line 110 of file screen.h.

§ scale()

static u_int8 screen::scale ( )
inlinestatic

Scale factor of the screen.

Definition at line 118 of file screen.h.

§ offset_x()

static u_int16 screen::offset_x ( )
inlinestatic

X offset of the viewport.

Definition at line 126 of file screen.h.

§ offset_y()

static u_int16 screen::offset_y ( )
inlinestatic

Y offset of the viewport.

Definition at line 134 of file screen.h.

§ clear()

static void screen::clear ( )
inlinestatic

Totally clears the screen with black.

Definition at line 143 of file screen.h.

§ show()

static void screen::show ( )
inlinestatic

Ensure the framebuffer is copied to the physical screen.

Definition at line 161 of file screen.h.

§ mode()

static u_int8 screen::mode ( )
inlinestatic

Returns whether the current mode is fullscreen or windowed.

Returns
  • 0: windowed mode.
  • 1: letterbox mode
  • 2: fullscreen mode

Definition at line 172 of file screen.h.

§ set_fullscreen()

bool screen::set_fullscreen ( const u_int8 m)
static

Sets fullscreen/windowed mode.

Parameters
mode
  • 0: windowed mode.
  • 1: letterbox mode
  • 2: fullscreen mode
Returns
  • true if the operation succeed.
  • false if the mode is already set, or the system doesn't support this mode.

Definition at line 211 of file screen.cc.

§ info()

string screen::info ( )
static

Returns information about the current screen settings, suitable for being displayed to the user.

Returns
printable information about the current screen settings.

Definition at line 179 of file screen.cc.

§ transition()

void screen::transition ( u_int16  i)
static

Make a nice transition effect.

Parameters
iadvancement of the transition (finished when i == screen::length () / 2)

Definition at line 347 of file screen.cc.

Member Data Documentation

§ display

surface screen::display
static

The actual screen surface.

It is publicly available so you can do fast operations on the screen. Manipulate it just as a classic surface.

Definition at line 70 of file screen.h.


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