kzs_surface.h File Reference

Drawable surface. More...

Classes

struct  kzsSurfaceNativeFunctions
 

Typedefs

typedef void(* kzsGLProcPointer) ()
 
typedef kzsError(* kzsSurfaceNativeCreateFunction) (const KzsDesktop *desktop, const KzsDisplay *display, const KzsSurfaceConfiguration *configuration, const KzsWindow *window, KzsSurfaceNative **out_surfaceNative)
 Creates a native surface. More...
 
typedef kzsError(* kzsSurfaceNativeDeleteFunction) (struct KzsSurfaceNative *surfaceNative)
 Deletes a native surface and frees all memory allocated for it. More...
 
typedef kzsError(* kzsSurfaceNativeSetActiveFunction) (struct KzsSurfaceNative *surfaceNative, kzBool active)
 Sets surface active. More...
 
typedef kzsError(* kzsSurfaceNativeUpdateFunction) (struct KzsSurfaceNative *surfaceNative)
 Updates the surface. More...
 
typedef kzsError(* kzsSurfaceNativeSetSwapIntervalFunction) (struct KzsSurfaceNative *surfaceNative, int interval)
 Specifies the minimum number of video frame periods per buffer swap. More...
 
typedef kzsError(* kzsSurfaceNativeReadPixelsFunction) (struct KzsSurfaceNative *surfaceNative, void *out_pixels)
 Copy color buffer data to the preallocated buffer out_pixels. More...
 
typedef void *(* kzsSurfaceNativeGetDisplayFunction) (struct KzsSurfaceNative *surfaceNative)
 Gets the display from native surface. More...
 
typedef void *(* kzsSurfaceNativeGetContextFunction) (struct KzsSurfaceNative *surfaceNative)
 Gets the context from native surface. More...
 
typedef kzsError(* kzsSurfaceGetUsedSurfaceNativePropertiesFunction) (const struct KzsSurfaceNative *surfaceNative, struct KzsSurfaceProperties *out_surfaceProperties)
 Sets used surface settings to the given surface properties struct. More...
 
typedef kzString(* kzsSurfaceNativeGetExtensionsFunction) (const struct KzsSurfaceNative *surfaceNative)
 Get list of native surface extensions. More...
 
typedef kzsGLProcPointer(* kzsSurfaceNativeGetProcAddressFunction) (const struct KzsSurfaceNative *surfaceNative, kzString functionName)
 Return GL procedure address. More...
 
typedef kzsError(* kzsSurfaceNativeCreateImageFunction) (const struct KzsSurfaceNative *surfaceNative, void *display, void *context, int target, void *data, int *attributes, void **out_image)
 
typedef kzsError(* kzsSurfaceNativeDeleteImageFunction) (const struct KzsSurfaceNative *surfaceNative, void *display, void *image)
 

Functions

KANZI_API kzsError kzsSurfaceCreate (const struct KzsDesktop *desktop, const struct KzsDisplay *display, const struct KzsSurfaceConfiguration *configuration, const struct KzsWindow *window, struct KzsSurface **out_surface)
 Creates a drawable surface for a window. More...
 
KANZI_API kzsError kzsSurfaceDestroy (struct KzsSurface *surface)
 Deletes a surface and frees all memory allocated for it. More...
 
KANZI_API kzsError kzsSurfaceSetActive (struct KzsSurface *surface, kzBool active)
 Makes a surface active for drawing or deactivates it. More...
 
KANZI_API kzsError kzsSurfaceUpdate (struct KzsSurface *surface)
 Updates the buffer to the screen. More...
 
KANZI_API kzsError kzsSurfaceResize (struct KzsSurface *surface, kzUint width, kzUint height)
 Resizes the surface. More...
 
KANZI_API kzsError kzsSurfaceSetSwapInterval (struct KzsSurface *surface, kzInt interval)
 Specifies the minimum number of video frame periods per buffer swap. More...
 
KANZI_API kzsError kzsSurfaceReadPixels (const struct KzsSurface *surface, void *out_pixels)
 Reads pixels from the surface. More...
 
KANZI_API kzsError kzsSurfaceCreateImage (const struct KzsSurface *surface, void *display, void *context, int target, void *data, int *attributes, void **out_image)
 Function for creating native image object, which can be shared between client APIs. More...
 
KANZI_API kzsError kzsSurfaceDeleteImage (const struct KzsSurface *surface, void *display, void *image)
 Function for deleting native image object. More...
 
KANZI_API kzsError kzsSurfaceGetUsedSurfaceProperties (struct KzsSurface *surface, struct KzsSurfaceProperties *out_surfaceProperties)
 Sets used surface settings to the given surface properties struct. More...
 
KANZI_API void kzsSurfaceLogProperties (struct KzsSurface *surface)
 Outputs the properties of the surface to the log. More...
 
KANZI_API kzsGLProcPointer kzsSurfaceGetProcAddress (struct KzsSurface *surface, kzString functionName)
 Get GL procedure address. More...
 
KANZI_API struct KzsGlGraphicsContext * kzsSurfaceGetGraphicsContext (const struct KzsSurface *surface)
 
KANZI_API void * kzsSurfaceGetDisplay (const struct KzsSurface *surface)
 
KANZI_API void * kzsSurfaceGetContext (const struct KzsSurface *surface)
 
KANZI_API kzString kzsSurfaceGetExtensions (const struct KzsSurface *surface)
 Get list of native surface extensions. More...
 

Detailed Description

Drawable surface.

Copyright 2008-2017 by Rightware. All rights reserved.

Typedef Documentation

typedef void(* kzsGLProcPointer) ()
typedef kzsError(* kzsSurfaceNativeCreateFunction) (const KzsDesktop *desktop, const KzsDisplay *display, const KzsSurfaceConfiguration *configuration, const KzsWindow *window, KzsSurfaceNative **out_surfaceNative)

Creates a native surface.

typedef kzsError(* kzsSurfaceNativeDeleteFunction) (struct KzsSurfaceNative *surfaceNative)

Deletes a native surface and frees all memory allocated for it.

typedef kzsError(* kzsSurfaceNativeSetActiveFunction) (struct KzsSurfaceNative *surfaceNative, kzBool active)

Sets surface active.

typedef kzsError(* kzsSurfaceNativeUpdateFunction) (struct KzsSurfaceNative *surfaceNative)

Updates the surface.

typedef kzsError(* kzsSurfaceNativeSetSwapIntervalFunction) (struct KzsSurfaceNative *surfaceNative, int interval)

Specifies the minimum number of video frame periods per buffer swap.

Negative interval values are reserved for platform-specific special cases.

typedef kzsError(* kzsSurfaceNativeReadPixelsFunction) (struct KzsSurfaceNative *surfaceNative, void *out_pixels)

Copy color buffer data to the preallocated buffer out_pixels.

typedef void*(* kzsSurfaceNativeGetDisplayFunction) (struct KzsSurfaceNative *surfaceNative)

Gets the display from native surface.

typedef void*(* kzsSurfaceNativeGetContextFunction) (struct KzsSurfaceNative *surfaceNative)

Gets the context from native surface.

typedef kzsError(* kzsSurfaceGetUsedSurfaceNativePropertiesFunction) (const struct KzsSurfaceNative *surfaceNative, struct KzsSurfaceProperties *out_surfaceProperties)

Sets used surface settings to the given surface properties struct.

typedef kzString(* kzsSurfaceNativeGetExtensionsFunction) (const struct KzsSurfaceNative *surfaceNative)

Get list of native surface extensions.

typedef kzsGLProcPointer(* kzsSurfaceNativeGetProcAddressFunction) (const struct KzsSurfaceNative *surfaceNative, kzString functionName)

Return GL procedure address.

typedef kzsError(* kzsSurfaceNativeCreateImageFunction) (const struct KzsSurfaceNative *surfaceNative, void *display, void *context, int target, void *data, int *attributes, void **out_image)
typedef kzsError(* kzsSurfaceNativeDeleteImageFunction) (const struct KzsSurfaceNative *surfaceNative, void *display, void *image)

Function Documentation

KANZI_API kzsError kzsSurfaceCreate ( const struct KzsDesktop desktop,
const struct KzsDisplay display,
const struct KzsSurfaceConfiguration configuration,
const struct KzsWindow window,
struct KzsSurface **  out_surface 
)

Creates a drawable surface for a window.

Graphics context of the new surface is shared with the currently active surface if the rendering APIs match. This function may change the active surface.

KANZI_API kzsError kzsSurfaceDestroy ( struct KzsSurface surface)

Deletes a surface and frees all memory allocated for it.

KANZI_API kzsError kzsSurfaceSetActive ( struct KzsSurface surface,
kzBool  active 
)

Makes a surface active for drawing or deactivates it.

Only one surface can be active at a time.

KANZI_API kzsError kzsSurfaceUpdate ( struct KzsSurface surface)

Updates the buffer to the screen.

KANZI_API kzsError kzsSurfaceResize ( struct KzsSurface surface,
kzUint  width,
kzUint  height 
)

Resizes the surface.

KANZI_API kzsError kzsSurfaceSetSwapInterval ( struct KzsSurface surface,
kzInt  interval 
)

Specifies the minimum number of video frame periods per buffer swap.

Negative interval values are reserved for platform-specific special cases.

KANZI_API kzsError kzsSurfaceReadPixels ( const struct KzsSurface surface,
void *  out_pixels 
)

Reads pixels from the surface.

KANZI_API kzsError kzsSurfaceCreateImage ( const struct KzsSurface surface,
void *  display,
void *  context,
int  target,
void *  data,
int *  attributes,
void **  out_image 
)

Function for creating native image object, which can be shared between client APIs.

KANZI_API kzsError kzsSurfaceDeleteImage ( const struct KzsSurface surface,
void *  display,
void *  image 
)

Function for deleting native image object.

KANZI_API kzsError kzsSurfaceGetUsedSurfaceProperties ( struct KzsSurface surface,
struct KzsSurfaceProperties out_surfaceProperties 
)

Sets used surface settings to the given surface properties struct.

KANZI_API void kzsSurfaceLogProperties ( struct KzsSurface surface)

Outputs the properties of the surface to the log.

KANZI_API kzsGLProcPointer kzsSurfaceGetProcAddress ( struct KzsSurface surface,
kzString  functionName 
)

Get GL procedure address.

KANZI_API struct KzsGlGraphicsContext* kzsSurfaceGetGraphicsContext ( const struct KzsSurface surface)
KANZI_API void* kzsSurfaceGetDisplay ( const struct KzsSurface surface)
KANZI_API void* kzsSurfaceGetContext ( const struct KzsSurface surface)
KANZI_API kzString kzsSurfaceGetExtensions ( const struct KzsSurface surface)

Get list of native surface extensions.