📄 ws.h
字号:
/* -*- c-file-style: "img" -*-
<module>
* Name : ws.h
* Title : Window System Interface API.
* Author : Marcus Shawcroft
* Created : 4 Nov 2003
*
* Copyright : 2003 by Imagination Technologies Limited.
* All rights reserved. No part of this software, either
* material or conceptual may be copied or distributed,
* transmitted, transcribed, stored in a retrieval system
* or translated into any human or computer language in any
* form by any means, electronic, mechanical, manual or
* other-wise, or disclosed to third parties without the
* express written permission of Imagination Technologies
* Limited, Unit 8, HomePark Industrial Estate,
* King's Langley, Hertfordshire, WD4 8LZ, U.K.
*
*
* Description : Window system interface API. Each window system
* implementation conforms to this API.
*
* Platform : ALL
*
</module>
*/
#ifndef _WS_H_
#define _WS_H_
#include "cfg-core.h"
#include "drvegl.h"
#include "egl_internal.h"
#ifdef __cplusplus
extern "C"
{
#endif
/*
<function>
FUNCTION: WS_GetDisplayCount ()
PURPOSE: Query the number of displays provided by the window system.
PARAMETERS: None.
RETURNS: Number of displays.
</function>
*/
EGLint
WS_GetDisplayCount (IMG_VOID);
/*
<function>
FUNCTION: WS_ValidateDisplay ()
PURPOSE: Confirm that the native display type is valid and record native information
PARAMETERS: In : hNativeDpy - Native display handle.
In : pKEGLDisplay - The KEGL display structure corresponding to the native display
RETURNS: IMG_TRUE if the display is valid
</function>
*/
IMG_BOOL
WS_ValidateDisplay (NativeDisplayType hNativeDpy, KEGL_DISPLAY* pKEGLDisplay);
/*
<function>
FUNCTION: WS_GetDisplay
PURPOSE: Find the EGLDisplay from a NativeDisplayType.
PARAMETERS: In: nativeDpy - Native display handle.
RETURNS: EGL display associated with the native handle or NULL.
</function>
*/
EGLDisplay
WS_GetDisplay (NativeDisplayType nativeDpy);
/*
<function>
FUNCTION: WS_MapEGLDisplay2WSDisplay
PURPOSE: Map the incoming NativeDpy to a value for use in the current windowing system
PARAMETERS: In: nativeDpy - Native display handle.
RETURNS: nativeDpy - remapped Native display handle.
</function>
*/
NativeDisplayType
WS_MapEGLDisplay2WSDisplay (NativeDisplayType nativeDpy);
/*
<function>
FUNCTION: WS_Open ()
PURPOSE: Open the window system for a specified display.
PARAMETERS: In: dpy - EGL display.
RETURNS: EGL_TRUE - Success.
EGL_FALSE - Failure.
</function>
*/
EGLint
WS_Open (GLESSysContext *psSysContext,
KEGL_DISPLAY *pDpy);
/*
<function>
FUNCTION: WS_Close
PURPOSE: Close the window system for a specified display.
PARAMETERS: In: pDpy - EGL display.
RETURNS: None
</function>
*/
void
WS_Close (KEGL_DISPLAY *pDpy);
/*
<function>
FUNCTION: WS_CfgVariants
PURPOSE:
Request the number of configuration variants the window system interface
can generate for the specified display. If this function returns N then
the WS_DeriveCfg function must be capable of generating variants 0..(N-1).
PARAMETERS: In: dpy - EGL display.
RETURNS: Number of configuration variants supported by the display.
</function>
*/
EGLint
WS_CfgVariants (KEGL_DISPLAY *dpy);
/*
<function>
FUNCTION: WS_CfgVariants
PURPOSE:
Derive a specified configuration variant for a specified display
based on a supplied generic EGL base configuration. The variant
requested will be numbered 0..(N-1) where N is the number returned
by the WS_CfgVariants function.
The generic EGL component will provide a set of base configurations
for the capabilities of OGL covering depth buffer and sample buffer
variations. The window system interface is expected to augment
these base configurations with specific values of ARGB and buffer
size.
PARAMETERS: In: dpy - EGL display.
RETURNS: Number of configuration variants supported by the display.
</function>
*/
KEGL_CONFIG *
WS_DeriveCfg (KEGL_DISPLAY *dpy,
KEGL_CONFIG *cfg,
EGLint variant);
/*
<function>
FUNCTION: WS_WindowValid
PURPOSE: Query if a native window handle still represents a valid
window.
PARAMETERS: In: window - Native window to test.
RETURNS: EGL_TRUE - Window is valid.
EGL_FALSE - Window is not valid.
</function>
*/
EGLBoolean
WS_WindowValid (NativeWindowType window);
/*
<function>
FUNCTION: WS_WaitNative
PURPOSE: Flush native rendering requests for window.
Requests to wait on a native surface which has become invalid
should return EGL_BAD_CURRENT_SURFACE.
PARAMETERS: In: window - window to flush
RETURNS: EGL_SUCCESS - Success.
Other EGL error code.
</function>
*/
EGLint
WS_WaitNative (KEGL_SURFACE *surface, EGLint engine);
/*
<function>
FUNCTION: WS_CompareNativeVisualType
PURPOSE:
The generic K-EGL component must be able to sort configs. The K-EGL
specification permits the window system interface to define the
sort order for native visual types if they are
used. Implementations which do not support native visual types
should return: 0 i.e. (a == b).
PARAMETERS: In: a - first native visual for comparison
In: b - second native visual for comparison
RETURNS:
0 :: a == b
<0 :: a < b
>0 :: a > b
</function>
*/
EGLint
WS_CompareNativeVisualType (EGLint a, EGLint b);
/*
<function>
FUNCTION : WS_CreateWindowDrawable
PURPOSE :
Validate and create a drawable from native window. Must validate the
native window against the surface configuration.
PARAMETERS :
In: pDpy - Display.
In: pSurface - Surface.
In: window - Native window.
RETURNS :
EGL_SUCCESS: pixmap conforms to config.
EGL_BAD_NATIVE_PIXMAP: invalid pixmap handle.
EGL_BAD_MATCH: pixmap does not conform to specified config.
</function>
*/
EGLint
WS_CreateWindowDrawable (KEGL_DISPLAY *pDpy,
KEGL_SURFACE *pSurface,
NativeWindowType nativeWindow);
/*
<function>
FUNCTION : WS_CreatePixmapDrawable
PURPOSE :
Validate and create a drawable from native pixmap. Must validate the
native pixmap against the surface configuration.
PARAMETERS :
In: pixmap - native pixmap
In: mode -
Out: phDrawable -
RETURNS :
EGL_SUCCESS: pixmap conforms to config.
EGL_BAD_NATIVE_PIXMAP: invalid pixmap handle.
EGL_BAD_MATCH: pixmap does not conform to specified config.
</function>
*/
EGLint
WS_CreatePixmapDrawable (KEGL_DISPLAY *dpy,
KEGL_SURFACE *surface,
NativePixmapType pixmap);
/*
<function>
FUNCTION : WS_DeleteDrawable
PURPOSE : Delete a drawable.
PARAMETERS : In: surface - Surface to delete.
In: system_context - System context.
RETURNS : None
</function>
*/
void
WS_DeleteDrawable (KEGL_SURFACE *surface,
GLESSysContext *system_context);
/*
<function>
FUNCTION : WS_SwapDrawable
PURPOSE : Swaps a drawable.
PARAMETERS : In: surface - Surface to swap.
RETURNS : None
</function>
*/
void
WS_SwapDrawable (KEGL_SURFACE *surface);
/*
<function>
FUNCTION : GetRotationAngle
PURPOSE : Get The rotation anfle of the current system.
PARAMETERS : None
RETURNS : Current angle in degrees
</function>
*/
IMG_UINT32
GetRotationAngle (void);
/*
<function>
FUNCTION : WS_CopyBuffers
PURPOSE : Copy source surface to target pixmap.
PARAMETERS : In: psSourceSurface - Surface to copy.
hTarget - Destination pixmap.
RETURNS : None
</function>
*/
EGLint
WS_CopyBuffers (KEGL_SURFACE *psSourceSurface,
NativePixmapType hTarget);
#ifdef __cplusplus
};
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -