Kanzi  3.9.4
Kanzi Engine API
kzs_surface.h File Reference

Drawable surface. More...

Classes

struct  kzsSurfaceNativeFunctions
 

Typedefs

typedef kzsError(* kzsSurfaceGetUsedSurfaceNativePropertiesFunction) (const struct KzsSurfaceNative *surfaceNative, struct KzsSurfaceProperties *out_surfaceProperties)
 Sets used surface settings to the given surface properties struct. More...
 
typedef kzsError(* kzsSurfaceNativeAttachToWindowFunction) (struct KzsSurfaceNative *, const KzsWindow *window)
 Attaches native surface to the given window. More...
 
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(* kzsSurfaceNativeCreateImageFunction) (const struct KzsSurfaceNative *surfaceNative, void *display, void *context, int target, void *data, int *attributes, void **out_image)
 
typedef kzsError(* kzsSurfaceNativeDeleteFunction) (struct KzsSurfaceNative *surfaceNative)
 Deletes a native surface and frees all memory allocated for it. More...
 
typedef kzsError(* kzsSurfaceNativeDeleteImageFunction) (const struct KzsSurfaceNative *surfaceNative, void *display, void *image)
 
typedef kzsError(* kzsSurfaceNativeDetachFromWindowFunction) (struct KzsSurfaceNative *surfaceNative)
 Detaches native surface from the window. More...
 
typedef void *(* kzsSurfaceNativeGetContextFunction) (struct KzsSurfaceNative *surfaceNative)
 Gets the context from native surface. More...
 
typedef void *(* kzsSurfaceNativeGetDisplayFunction) (struct KzsSurfaceNative *surfaceNative)
 Gets the display from native surface. 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(* kzsSurfaceNativeReadPixelsFunction) (struct KzsSurfaceNative *surfaceNative, void *out_pixels)
 Copy color buffer data to the preallocated buffer out_pixels. More...
 
typedef kzsError(* kzsSurfaceNativeSetActiveFunction) (struct KzsSurfaceNative *surfaceNative, kzBool active)
 Sets surface active. More...
 
typedef kzsError(* kzsSurfaceNativeSetSwapIntervalFunction) (struct KzsSurfaceNative *surfaceNative, int interval)
 Specifies the minimum number of video frame periods per buffer swap. More...
 
typedef kzsError(* kzsSurfaceNativeUpdateFunction) (struct KzsSurfaceNative *surfaceNative)
 Updates the surface. More...
 

Functions

kzsError kzsSurfaceAttachToWindow (struct KzsSurface *surface, const struct KzsWindow *window)
 Attaches native surface to a window. More...
 
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 kzsSurfaceCreateFromNative (struct KzsSurfaceNative *surfaceNative, const struct KzsSurfaceConfiguration *configuration, struct KzsSurface **out_surface)
 Creates a surface and attaches it to given native surface. More...
 
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...
 
kzsError kzsSurfaceDeleteImage (const struct KzsSurface *surface, void *display, void *image)
 Function for deleting native image object. More...
 
kzsError kzsSurfaceDestroy (struct KzsSurface *surface)
 Deletes a surface and frees all memory allocated for it. More...
 
kzsError kzsSurfaceDetachFromWindow (struct KzsSurface *surface)
 Detaches native surface from a window. More...
 
void * kzsSurfaceGetContext (const struct KzsSurface *surface)
 
void * kzsSurfaceGetDisplay (const struct KzsSurface *surface)
 
kzString kzsSurfaceGetExtensions (const struct KzsSurface *surface)
 Get list of native surface extensions. More...
 
kzsGLProcPointer kzsSurfaceGetProcAddress (struct KzsSurface *surface, kzString functionName)
 Get GL procedure address. More...
 
kzsError kzsSurfaceGetUsedSurfaceProperties (struct KzsSurface *surface, struct KzsSurfaceProperties *out_surfaceProperties)
 Sets used surface settings to the given surface properties struct. More...
 
void kzsSurfaceLogProperties (struct KzsSurface *surface)
 Outputs the properties of the surface to the log. More...
 
kzsError kzsSurfaceReadPixels (const struct KzsSurface *surface, void *out_pixels)
 Reads pixels from the surface. More...
 
kzsError kzsSurfaceResize (struct KzsSurface *surface, kzUint width, kzUint height)
 Resizes the surface. More...
 
kzsError kzsSurfaceSetActive (struct KzsSurface *surface, kzBool active)
 Makes a surface active for drawing or deactivates it. More...
 
kzsError kzsSurfaceSetNativeSurface (struct KzsSurface *surface, struct KzsSurfaceNative *surfaceNative)
 Attaches a given native surface to a surface. More...
 
kzsError kzsSurfaceSetSwapInterval (struct KzsSurface *surface, kzInt interval)
 Specifies the minimum number of video frame periods per buffer swap. More...
 
kzsError kzsSurfaceUpdate (struct KzsSurface *surface)
 Updates the buffer to the screen. More...
 

Detailed Description

Drawable surface.

Copyright 2008-2017 by Rightware. All rights reserved.

Typedef Documentation

◆ kzsSurfaceNativeCreateFunction

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

Creates a native surface.

◆ kzsSurfaceNativeDeleteFunction

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

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

◆ kzsSurfaceNativeSetActiveFunction

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

Sets surface active.

◆ kzsSurfaceNativeUpdateFunction

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

Updates the surface.

◆ kzsSurfaceNativeSetSwapIntervalFunction

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.

◆ kzsSurfaceNativeReadPixelsFunction

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

Copy color buffer data to the preallocated buffer out_pixels.

◆ kzsSurfaceNativeGetDisplayFunction

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

Gets the display from native surface.

◆ kzsSurfaceNativeGetContextFunction

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

Gets the context from native surface.

◆ kzsSurfaceGetUsedSurfaceNativePropertiesFunction

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

Sets used surface settings to the given surface properties struct.

◆ kzsSurfaceNativeGetExtensionsFunction

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

Get list of native surface extensions.

◆ kzsSurfaceNativeGetProcAddressFunction

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

Return GL procedure address.

◆ kzsSurfaceNativeCreateImageFunction

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

◆ kzsSurfaceNativeDeleteImageFunction

typedef kzsError(* kzsSurfaceNativeDeleteImageFunction) (const struct KzsSurfaceNative *surfaceNative, void *display, void *image)

◆ kzsSurfaceNativeAttachToWindowFunction

typedef kzsError(* kzsSurfaceNativeAttachToWindowFunction) (struct KzsSurfaceNative *, const KzsWindow *window)

Attaches native surface to the given window.

◆ kzsSurfaceNativeDetachFromWindowFunction

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

Detaches native surface from the window.

Function Documentation

◆ kzsSurfaceCreate()

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.

◆ kzsSurfaceCreateFromNative()

kzsError kzsSurfaceCreateFromNative ( struct KzsSurfaceNative *  surfaceNative,
const struct KzsSurfaceConfiguration configuration,
struct KzsSurface **  out_surface 
)

Creates a surface and attaches it to given native surface.

◆ kzsSurfaceDestroy()

kzsError kzsSurfaceDestroy ( struct KzsSurface surface)

Deletes a surface and frees all memory allocated for it.

◆ kzsSurfaceSetActive()

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.

◆ kzsSurfaceUpdate()

kzsError kzsSurfaceUpdate ( struct KzsSurface surface)

Updates the buffer to the screen.

◆ kzsSurfaceResize()

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

Resizes the surface.

◆ kzsSurfaceSetNativeSurface()

kzsError kzsSurfaceSetNativeSurface ( struct KzsSurface surface,
struct KzsSurfaceNative *  surfaceNative 
)

Attaches a given native surface to a surface.

◆ kzsSurfaceSetSwapInterval()

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.

◆ kzsSurfaceReadPixels()

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

Reads pixels from the surface.

◆ kzsSurfaceCreateImage()

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.

◆ kzsSurfaceDeleteImage()

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

Function for deleting native image object.

◆ kzsSurfaceGetUsedSurfaceProperties()

kzsError kzsSurfaceGetUsedSurfaceProperties ( struct KzsSurface surface,
struct KzsSurfaceProperties out_surfaceProperties 
)

Sets used surface settings to the given surface properties struct.

◆ kzsSurfaceLogProperties()

void kzsSurfaceLogProperties ( struct KzsSurface surface)

Outputs the properties of the surface to the log.

◆ kzsSurfaceGetProcAddress()

kzsGLProcPointer kzsSurfaceGetProcAddress ( struct KzsSurface surface,
kzString  functionName 
)

Get GL procedure address.

◆ kzsSurfaceGetDisplay()

void* kzsSurfaceGetDisplay ( const struct KzsSurface surface)

◆ kzsSurfaceGetContext()

void* kzsSurfaceGetContext ( const struct KzsSurface surface)

◆ kzsSurfaceGetExtensions()

kzString kzsSurfaceGetExtensions ( const struct KzsSurface surface)

Get list of native surface extensions.

◆ kzsSurfaceAttachToWindow()

kzsError kzsSurfaceAttachToWindow ( struct KzsSurface surface,
const struct KzsWindow window 
)

Attaches native surface to a window.

This function needs not to be called unless the window specified in kzsSurfaceCreate() is to be changed.

◆ kzsSurfaceDetachFromWindow()

kzsError kzsSurfaceDetachFromWindow ( struct KzsSurface surface)

Detaches native surface from a window.

This function needs not to be called unless the window specified in kzsSurfaceCreate() is to be changed.