Kanzi Graphics Engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
kzs_surface.h File Reference

Drawable surface. More...

Macros

#define KZS_SURFACE_PROPERTY_DONT_CARE
 Indicates that the implementation can choose any value for a surface property. More...
 

Functions

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...
 
kzsError kzsSurfaceDelete (struct KzsSurface *surface)
 Deletes a surface and frees all memory allocated for it. More...
 
kzsError kzsSurfaceSetActive (const struct KzsSurface *surface, kzBool active)
 Makes a surface active for drawing or deactivates it. More...
 
kzsError kzsSurfaceUpdate (const struct KzsSurface *surface)
 Updates the buffer to the screen. More...
 
kzsError kzsSurfaceResize (struct KzsSurface *surface, kzUint width, kzUint height)
 Resizes the surface. More...
 
kzsError kzsSurfaceSetSwapInterval (struct KzsSurface *surface, kzInt interval)
 Specifies the minimum number of video frame periods per buffer swap. More...
 
kzsError kzsSurfaceReadPixels (const struct KzsSurface *surface, void *out_pixels)
 Reads pixels from the surface. More...
 
kzsError kzsSurfaceNativeCreate (const struct KzsDesktop *desktop, const struct KzsDisplay *display, const struct KzsSurfaceConfiguration *configuration, const struct KzsWindow *window, struct KzsSurfaceNative **out_surfaceNative)
 Creates a native surface. More...
 
kzsError kzsSurfaceNativeDelete (struct KzsSurfaceNative *surfaceNative)
 Deletes a native surface and frees all memory allocated for it. More...
 
kzsError kzsSurfaceNativeSetActive (struct KzsSurfaceNative *surfaceNative, kzBool active)
 Sets surface active. More...
 
kzsError kzsSurfaceNativeUpdate (struct KzsSurfaceNative *surfaceNative)
 Updates the surface. More...
 
kzsError kzsSurfaceNativeSetSwapInterval (struct KzsSurfaceNative *surfaceNative, kzInt interval)
 Specifies the minimum number of video frame periods per buffer swap. More...
 
kzsError kzsSurfaceNativeReadPixels (struct KzsSurfaceNative *surfaceNative, void *out_pixels)
 Copy color buffer data to the preallocated buffer out_pixels. More...
 
kzsError kzsSurfaceNativeCreateImage (void *display, void *context, kzInt target, void *data, kzInt *attributes, void **out_image)
 Function for creating native image object, which can be shared between client APIs. More...
 
kzsError kzsSurfaceNativeDeleteImage (void *display, void *image)
 Function for deleting native image object. More...
 
voidkzsSurfaceNativeGetDisplay (struct KzsSurfaceNative *surfaceNative)
 Gets the display from native surface. More...
 
voidkzsSurfaceNativeGetContext (struct KzsSurfaceNative *surfaceNative)
 Gets the context from native surface. More...
 
struct KzsSurfaceNative * kzsSurfaceGetNativeSurface (const struct KzsSurface *surface)
 Get native surface from surface. More...
 
kzString kzsSurfaceNativeGetExtensions (struct KzsSurfaceNative *surfaceNative)
 Get list of native surface extensions. More...
 
kzsError kzsSurfaceGetUsedSurfaceProperties (const struct KzsSurface *surface, struct KzsSurfaceProperties *out_surfaceProperties)
 Sets used surface settings to the given surface properties struct. More...
 
kzsError kzsSurfaceGetUsedSurfaceNativeProperties (const struct KzsSurfaceNative *surfaceNative, struct KzsSurfaceProperties *out_surfaceProperties)
 Sets used surface settings to the given surface properties struct. More...
 

Detailed Description

Drawable surface.

Copyright 2008-2019 by Rightware. All rights reserved.

Macro Definition Documentation

#define KZS_SURFACE_PROPERTY_DONT_CARE

Indicates that the implementation can choose any value for a surface property.

Function Documentation

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.

kzsError kzsSurfaceDelete ( struct KzsSurface surface)

Deletes a surface and frees all memory allocated for it.

kzsError kzsSurfaceSetActive ( const struct KzsSurface surface,
kzBool  active 
)

Makes a surface active for drawing or deactivates it.

Only one surface can be active at a time.

kzsError kzsSurfaceUpdate ( const struct KzsSurface surface)

Updates the buffer to the screen.

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

Resizes the surface.

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.

kzsError kzsSurfaceReadPixels ( const struct KzsSurface surface,
void out_pixels 
)

Reads pixels from the surface.

kzsError kzsSurfaceNativeCreate ( const struct KzsDesktop desktop,
const struct KzsDisplay display,
const struct KzsSurfaceConfiguration configuration,
const struct KzsWindow window,
struct KzsSurfaceNative **  out_surfaceNative 
)

Creates a native surface.

kzsError kzsSurfaceNativeDelete ( struct KzsSurfaceNative *  surfaceNative)

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

kzsError kzsSurfaceNativeSetActive ( struct KzsSurfaceNative *  surfaceNative,
kzBool  active 
)

Sets surface active.

kzsError kzsSurfaceNativeUpdate ( struct KzsSurfaceNative *  surfaceNative)

Updates the surface.

kzsError kzsSurfaceNativeSetSwapInterval ( struct KzsSurfaceNative *  surfaceNative,
kzInt  interval 
)

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

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

kzsError kzsSurfaceNativeReadPixels ( struct KzsSurfaceNative *  surfaceNative,
void out_pixels 
)

Copy color buffer data to the preallocated buffer out_pixels.

kzsError kzsSurfaceNativeCreateImage ( void display,
void context,
kzInt  target,
void data,
kzInt attributes,
void **  out_image 
)

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

kzsError kzsSurfaceNativeDeleteImage ( void display,
void image 
)

Function for deleting native image object.

void* kzsSurfaceNativeGetDisplay ( struct KzsSurfaceNative *  surfaceNative)

Gets the display from native surface.

void* kzsSurfaceNativeGetContext ( struct KzsSurfaceNative *  surfaceNative)

Gets the context from native surface.

struct KzsSurfaceNative* kzsSurfaceGetNativeSurface ( const struct KzsSurface surface)

Get native surface from surface.

kzString kzsSurfaceNativeGetExtensions ( struct KzsSurfaceNative *  surfaceNative)

Get list of native surface extensions.

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

Sets used surface settings to the given surface properties struct.

kzsError kzsSurfaceGetUsedSurfaceNativeProperties ( const struct KzsSurfaceNative *  surfaceNative,
struct KzsSurfaceProperties out_surfaceProperties 
)

Sets used surface settings to the given surface properties struct.