Graphic-Display

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.

Summary
Graphic-DisplayWraps the OS specific display initialization for the graphics display into a thin layer to make other modules OS independent.
CopyrightThis program is free software.
Files
C-kern/api/graphic/display.hHeader file Graphic-Display.
C-kern/graphic/display.cImplementation file Graphic-Display impl.
Types
struct display_tExport display_t into global namespace.
Functions
test
unittest_graphic_displayTest display_t functionality.
display_tWraps the OS specific graphics display.
lifetime
display_FREEStatic initializer.
initdefault_displayInitializes disp with a connection to the default display.
free_displayFrees all resources associated wth the display.
query
defaultscreennr_displayReturns the number of the default screens attached to this display.
nrofscreens_displayReturns the number of different screens attached to this display.
gl_displayReturns a pointer to a native opengl display.
os_displayReturns a pointer to a native display.
castfromos_displayCasts pointer to osdisplay into pointer to display_t.
update
inline implementation
display_t
castfromos_displayImplements display_t.castfromos_display.
gl_displayImplements display_t.gl_display.
os_displayImplements display_t.os_display.

Copyright

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.

Author

© 2014 Jörg Seebohn

Files

C-kern/api/graphic/display.h

Header file Graphic-Display.

C-kern/graphic/display.c

Implementation file Graphic-Display impl.

Types

struct display_t

typedef struct display_t display_t

Export display_t into global namespace.

Functions

Summary

test

unittest_graphic_display

int unittest_graphic_display(void)

Test display_t functionality.

display_t

struct display_t

Wraps the OS specific graphics display.  Support OpenGL / GLES.

Summary
lifetime
display_FREEStatic initializer.
initdefault_displayInitializes disp with a connection to the default display.
free_displayFrees all resources associated wth the display.
query
defaultscreennr_displayReturns the number of the default screens attached to this display.
nrofscreens_displayReturns the number of different screens attached to this display.
gl_displayReturns a pointer to a native opengl display.
os_displayReturns a pointer to a native display.
castfromos_displayCasts pointer to osdisplay into pointer to display_t.
update

lifetime

display_FREE

#define display_FREE { x11display_FREE, egldisplay_FREE }

Static initializer.

initdefault_display

int initdefault_display(/*out*/display_t *disp)

Initializes disp with a connection to the default display.

free_display

int free_display(display_t *disp)

Frees all resources associated wth the display.  You should free other resources which depend on the diplay connection before calling this function.

query

defaultscreennr_display

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.

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.

gl_display

struct opengl_display_t * gl_display(const display_t *disp)

Returns a pointer to a native opengl display.

os_display

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.

castfromos_display

display_t * castfromos_display(const void *osdisplay)

Casts pointer to osdisplay into pointer to display_t.

update

display_t

castfromos_display

#define castfromos_display(
   from_osdisplay
) ( __extension__ ({ typeof(((display_t*)0)->osdisplay) * _from = (from_osdisplay); (display_t*) _from; }))

Implements display_t.castfromos_display.

gl_display

#define gl_display(disp) ((disp)->gldisplay)

Implements display_t.gl_display.

os_display

#define os_display(disp) (&(disp)->osdisplay)

Implements display_t.os_display.

Wraps the OS specific display initialization for the graphics display into a thin layer to make other modules OS independent.
Implements Graphic-Display.
typedef struct display_t display_t
Export display_t into global namespace.
struct display_t
Wraps the OS specific graphics display.
int unittest_graphic_display(void)
Test display_t functionality.
#define display_FREE { x11display_FREE, egldisplay_FREE }
Static initializer.
int initdefault_display(/*out*/display_t *disp)
Initializes disp with a connection to the default display.
int free_display(display_t *disp)
Frees all resources associated wth the display.
uint32_t defaultscreennr_display(const display_t *disp)
Returns the number of the default screens attached to this display.
uint32_t nrofscreens_display(const display_t *disp)
Returns the number of different screens attached to this display.
struct opengl_display_t * gl_display(const display_t *disp)
Returns a pointer to a native opengl display.
void * os_display(const display_t *disp)
Returns a pointer to a native display.
display_t * castfromos_display(const void *osdisplay)
Casts pointer to osdisplay into pointer to display_t.
#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.
Close