Graphic-Surface

Wraps an OS specific OpenGL surface to make other modules OS independent.  A surface abstracts the frame buffer (color, depth, stencil, ...).

Supports OpenGL / GLES for drawing operations.

Summary
Graphic-SurfaceWraps an OS specific OpenGL surface to make other modules OS independent.
CopyrightThis program is free software.
Files
C-kern/api/graphic/surface.hHeader file Graphic-Surface.
C-kern/graphic/surface.cImplementation file Graphic-Surface impl.
Types
opengl_surface_tType which tags the native implementation of an OpenGL surface.
struct surface_tExport surface_t into global namespace.
Functions
test
unittest_graphic_surfaceTest surface_t functionality.
surface_tWraps a native OpenGL surface (frame buffer).
lifetime
surface_FREEStatic initializer.
surface_FREE_EMBEDDEDStatic initializer for types which inherit from surface_t with surface_EMBED.
generic
surface_EMBEDInherits from surface_t by embedding all data fields.
query
gl_surfaceReturns the native OpenGL surface type tagged with (opengl_surface_t*).
isfree_surfaceReturns true if surf->glsurface is set to 0.
inline implementation
surface_t
gl_surfaceImplements surface_t.gl_surface.
isfree_surfaceImplements surface_t.isfree_surface.

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/surface.h

Header file Graphic-Surface.

C-kern/graphic/surface.c

Implementation file Graphic-Surface impl.

Types

opengl_surface_t

typedef struct opengl_surface_t opengl_surface_t

Type which tags the native implementation of an OpenGL surface.

struct surface_t

typedef struct surface_t surface_t

Export surface_t into global namespace.

Functions

Summary

test

unittest_graphic_surface

int unittest_graphic_surface(void)

Test surface_t functionality.

surface_t

struct surface_t

Wraps a native OpenGL surface (frame buffer).  Use gl_surface to query for the native type.

Summary
lifetime
surface_FREEStatic initializer.
surface_FREE_EMBEDDEDStatic initializer for types which inherit from surface_t with surface_EMBED.
generic
surface_EMBEDInherits from surface_t by embedding all data fields.
query
gl_surfaceReturns the native OpenGL surface type tagged with (opengl_surface_t*).
isfree_surfaceReturns true if surf->glsurface is set to 0.

lifetime

surface_FREE

#define surface_FREE { 0 }

Static initializer.

surface_FREE_EMBEDDED

#define surface_FREE_EMBEDDED 0

Static initializer for types which inherit from surface_t with surface_EMBED.

generic

surface_EMBED

#define surface_EMBED struct opengl_surface_t * glsurface

Inherits from surface_t by embedding all data fields.

query

gl_surface

struct opengl_surface_t * gl_surface(surface_t *surf)

Returns the native OpenGL surface type tagged with (opengl_surface_t*).

isfree_surface

bool isfree_surface(const surface_t *surf)

Returns true if surf->glsurface is set to 0.

inline implementation

surface_t

gl_surface

#define gl_surface(surf) ((surf)->glsurface)

Implements surface_t.gl_surface.

isfree_surface

#define isfree_surface(surf) (0 == (surf)->glsurface)

Implements surface_t.isfree_surface.

Wraps an OS specific OpenGL surface to make other modules OS independent.
Implements Graphic-Surface.
typedef struct opengl_surface_t opengl_surface_t
Type which tags the native implementation of an OpenGL surface.
typedef struct surface_t surface_t
Export surface_t into global namespace.
struct surface_t
Wraps a native OpenGL surface (frame buffer).
int unittest_graphic_surface(void)
Test surface_t functionality.
#define surface_FREE { 0 }
Static initializer.
#define surface_FREE_EMBEDDED 0
Static initializer for types which inherit from surface_t with surface_EMBED.
#define surface_EMBED struct opengl_surface_t * glsurface
Inherits from surface_t by embedding all data fields.
struct opengl_surface_t * gl_surface(surface_t *surf)
Returns the native OpenGL surface type tagged with (opengl_surface_t*).
bool isfree_surface(const surface_t *surf)
Returns true if surf->glsurface is set to 0.
#define gl_surface(surf) ((surf)->glsurface)
Implements surface_t.gl_surface.
#define isfree_surface(surf) (0 == (surf)->glsurface)
Implements surface_t.isfree_surface.
Close