Wraps the OS specific display initialization for the graphics display into a thin layer to make other modules OS independent.
Supports OpenGL / GLES for drawing operations.
Graphic-Display | Wraps the OS specific display initialization for the graphics display into a thin layer to make other modules OS independent. |
Copyright | This program is free software. |
Files | |
C-kern/ | Header file Graphic-Display. |
C-kern/ | Implementation file Graphic-Display impl. |
Types | |
struct display_t | Export display_t into global namespace. |
Functions | |
test | |
unittest_graphic_display | Test display_t functionality. |
display_t | Wraps the OS specific graphics display. |
lifetime | |
display_FREE | Static initializer. |
initdefault_display | Initializes disp with a connection to the default display. |
free_display | Frees all resources associated wth the display. |
query | |
defaultscreennr_display | Returns the number of the default screens attached to this display. |
nrofscreens_display | Returns the number of different screens attached to this display. |
gl_display | Returns a pointer to a native opengl display. |
os_display | Returns a pointer to a native display. |
castfromos_display | Casts pointer to osdisplay into pointer to display_t. |
update | |
inline implementation | |
display_t | |
castfromos_display | Implements display_t.castfromos_display. |
gl_display | Implements display_t.gl_display. |
os_display | Implements display_t.os_display. |
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
© 2014 Jörg Seebohn
Header file Graphic-Display.
Implementation file Graphic-Display impl.
typedef struct display_t display_t
Export display_t into global namespace.
test | |
unittest_graphic_display | Test display_t functionality. |
int unittest_graphic_display( void )
Test display_t functionality.
struct display_t
Wraps the OS specific graphics display. Support OpenGL / GLES.
lifetime | |
display_FREE | Static initializer. |
initdefault_display | Initializes disp with a connection to the default display. |
free_display | Frees all resources associated wth the display. |
query | |
defaultscreennr_display | Returns the number of the default screens attached to this display. |
nrofscreens_display | Returns the number of different screens attached to this display. |
gl_display | Returns a pointer to a native opengl display. |
os_display | Returns a pointer to a native display. |
castfromos_display | Casts pointer to osdisplay into pointer to display_t. |
update |
uint32_t defaultscreennr_display( const display_t * disp )
Returns the number of the default screens attached to this display. The returns value is always less than the value returned by nrofscreens_display.
uint32_t nrofscreens_display( const display_t * disp )
Returns the number of different screens attached to this display. A display represents a set of graphics cards driven by a single driver. If more than one display monitor is attached, it is possible to configure the display to have a single screen as as large as the screen estate of all monitors together or to configure it to have multiple screens controlled independently.
void * os_display( const display_t * disp )
Returns a pointer to a native display. This function is implemented as a macro and therefore returns a pointer to the real native type and not void. It is possible that gl_display returns the same pointer except for the type. In case of EGL as OpenGL adaption layer both pointers differ.
display_t * castfromos_display( const void * osdisplay )
Casts pointer to osdisplay into pointer to display_t.
display_t | |
castfromos_display | Implements display_t.castfromos_display. |
gl_display | Implements display_t.gl_display. |
os_display | Implements display_t.os_display. |
#define castfromos_display( from_osdisplay ) ( __extension__ ({ typeof(((display_t*)0)->osdisplay) * _from = (from_osdisplay); (display_t*) _from; }))
Implements display_t.castfromos_display.
#define gl_display( disp ) ((disp)->gldisplay)
Implements display_t.gl_display.
#define os_display( disp ) (&(disp)->osdisplay)
Implements display_t.os_display.
Export display_t into global namespace.
typedef struct display_t display_t
Wraps the OS specific graphics display.
struct display_t
Test display_t functionality.
int unittest_graphic_display( void )
Static initializer.
#define display_FREE { x11display_FREE, egldisplay_FREE }
Initializes disp with a connection to the default display.
int initdefault_display( /*out*/display_t * disp )
Frees all resources associated wth the display.
int free_display( display_t * disp )
Returns the number of the default screens attached to this display.
uint32_t defaultscreennr_display( const display_t * disp )
Returns the number of different screens attached to this display.
uint32_t nrofscreens_display( const display_t * disp )
Returns a pointer to a native opengl display.
struct opengl_display_t * gl_display( const display_t * disp )
Returns a pointer to a native display.
void * os_display( const display_t * disp )
Casts pointer to osdisplay into pointer to display_t.
display_t * castfromos_display( const void * osdisplay )
Implements display_t.castfromos_display.
#define castfromos_display( from_osdisplay ) ( __extension__ ({ typeof(((display_t*)0)->osdisplay) * _from = (from_osdisplay); (display_t*) _from; }))
Implements display_t.gl_display.
#define gl_display( disp ) ((disp)->gldisplay)
Implements display_t.os_display.
#define os_display( disp ) (&(disp)->osdisplay)