Kanzi 3.9.10
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.
 
typedef kzsError(* kzsSurfaceNativeAttachToWindowFunction) (struct KzsSurfaceNative *, const KzsWindow *window)
 Attaches native surface to the given window.
 
typedef kzsError(* kzsSurfaceNativeCreateFunction) (const KzsDesktop *desktop, const KzsDisplay *display, const KzsSurfaceConfiguration *configuration, const KzsWindow *window, KzsSurfaceNative **out_surfaceNative)
 Creates a native surface.
 
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.
 
typedef kzsError(* kzsSurfaceNativeDeleteImageFunction) (const struct KzsSurfaceNative *surfaceNative, void *display, void *image)
 
typedef kzsError(* kzsSurfaceNativeDetachFromWindowFunction) (struct KzsSurfaceNative *surfaceNative)
 Detaches native surface from the window.
 
typedef void *(* kzsSurfaceNativeGetContextFunction) (struct KzsSurfaceNative *surfaceNative)
 Gets the context from native surface.
 
typedef void *(* kzsSurfaceNativeGetDisplayFunction) (struct KzsSurfaceNative *surfaceNative)
 Gets the display from native surface.
 
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(* kzsSurfaceNativeReadPixelsFunction) (struct KzsSurfaceNative *surfaceNative, void *out_pixels)
 Copy color buffer data to the preallocated buffer out_pixels.
 
typedef kzsError(* kzsSurfaceNativeSetActiveFunction) (struct KzsSurfaceNative *surfaceNative, kzBool active)
 Sets surface active.
 
typedef kzsError(* kzsSurfaceNativeSetSwapIntervalFunction) (struct KzsSurfaceNative *surfaceNative, int interval)
 Specifies the minimum number of video frame periods per buffer swap.
 
typedef kzsError(* kzsSurfaceNativeUpdateFunction) (struct KzsSurfaceNative *surfaceNative)
 Updates the surface.
 

Functions

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

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.