| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470 |
- /****************************************************************************
- *
- * Copyright (c) 2005 - 2010 by Vivante Corp. All rights reserved.
- *
- * The material in this file is confidential and contains trade secrets
- * of Vivante Corporation. This is proprietary information owned by
- * Vivante Corporation. No part of this work may be disclosed,
- * reproduced, copied, transmitted, or used in any way for any purpose,
- * without the express written permission of Vivante Corporation.
- *
- *****************************************************************************
- *
- * Auto-generated file on 4/22/2010. Do not edit!!!
- *
- *****************************************************************************/
- #ifndef __vdk_h_
- #define __vdk_h_
- /* Include VDK types. */
- #include "vdkTypes.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- /*******************************************************************************
- ** Define VDKAPI and VDKLANG macros. *******************************************
- **
- ** VDKAPI Import or export function scope.
- ** VDKLANG Language defintion of function.
- */
- #ifdef WIN32
- # ifdef __VDK_EXPORT
- # define VDKAPI __declspec(dllexport)
- # else
- # define VDKAPI __declspec(dllimport)
- # endif
- # define VDKLANG __cdecl
- #else
- # define VDKAPI
- # define VDKLANG
- #endif
- /*******************************************************************************
- ** Initialization. *************************************************************
- */
- VDKAPI vdkPrivate VDKLANG
- vdkInitialize(
- void
- );
- VDKAPI void VDKLANG
- vdkExit(
- vdkPrivate Private
- );
- /*******************************************************************************
- ** Display. ********************************************************************
- */
- VDKAPI vdkDisplay VDKLANG
- vdkGetDisplay(
- vdkPrivate Private
- );
- VDKAPI int VDKLANG
- vdkGetDisplayInfo(
- vdkDisplay Display,
- int * Width,
- int * Height,
- unsigned long * Physical,
- int * Stride,
- int * BitsPerPixel
- );
- #if USE_FB_DOUBLE_BUFFER
- VDKAPI int VDKLANG
- vdkDisplayBuffer(
- vdkDisplay Display,
- int Buffer
- );
- #endif
- /* VFK_DISPLAY_INFO structure defining information returned by
- vdkGetDisplayInfoEx. */
- typedef struct _vdkDISPLAY_INFO
- {
- /* The size of the display in pixels. */
- int width;
- int height;
- /* The stride of the dispay. -1 is returned if the stride is not known
- for the specified display.*/
- int stride;
- /* The color depth of the display in bits per pixel. */
- int bitsPerPixel;
- /* The logical pointer to the display memory buffer. NULL is returned
- if the pointer is not known for the specified display. */
- void * logical;
- /* The physical address of the display memory buffer. ~0 is returned
- if the address is not known for the specified display. */
- unsigned long physical;
- }
- vdkDISPLAY_INFO;
- VDKAPI int VDKLANG
- vdkGetDisplayInfoEx(
- vdkDisplay Display,
- unsigned int DisplayInfoSize,
- vdkDISPLAY_INFO * DisplayInfo
- );
- VDKAPI void VDKLANG
- vdkDestroyDisplay(
- vdkDisplay Display
- );
- /*******************************************************************************
- ** Windows. ********************************************************************
- */
- VDKAPI vdkWindow VDKLANG
- vdkCreateWindow(
- vdkDisplay Display,
- int X,
- int Y,
- int Width,
- int Height
- );
- VDKAPI int VDKLANG
- vdkGetWindowInfo(
- vdkWindow Window,
- int * X,
- int * Y,
- int * Width,
- int * Height,
- int * BitsPerPixel,
- unsigned int * Offset
- );
- VDKAPI void VDKLANG
- vdkDestroyWindow(
- vdkWindow Window
- );
- VDKAPI void VDKLANG
- vdkSetWindowTitle(
- vdkWindow Window,
- const char * Title
- );
- VDKAPI int VDKLANG
- vdkShowWindow(
- vdkWindow Window
- );
- VDKAPI int VDKLANG
- vdkHideWindow(
- vdkWindow Window
- );
- VDKAPI int VDKLANG
- vdkDrawImage(
- vdkWindow Window,
- int Left,
- int Top,
- int Right,
- int Bottom,
- int Width,
- int Height,
- int BitsPerPixel,
- void * Bits
- );
- VDKAPI int VDKLANG
- vdkGetImage(
- vdkWindow Window,
- int Left,
- int Top,
- int Right,
- int Bottom,
- int * BitsPerPixel,
- void ** Bits
- );
- VDKAPI void VDKLANG
- vdkCapturePointer(
- vdkWindow Window
- );
- /*******************************************************************************
- ** Pixmaps. ********************************************************************
- */
- VDKAPI vdkPixmap VDKLANG
- vdkCreatePixmap(
- vdkDisplay Display,
- int Width,
- int Height,
- int BitsPerPixel
- );
- VDKAPI int VDKLANG
- vdkGetPixmapInfo(
- vdkPixmap Pixmap,
- int * Width,
- int * Height,
- int * BitsPerPixel,
- int * Stride,
- void ** Bits
- );
- VDKAPI int VDKLANG
- vdkDrawPixmap(
- vdkPixmap Pixmap,
- int Left,
- int Top,
- int Right,
- int Bottom,
- int Width,
- int Height,
- int BitsPerPixel,
- void * Bits
- );
- VDKAPI void VDKLANG
- vdkDestroyPixmap(
- vdkPixmap Pixmap
- );
- /*******************************************************************************
- ** Events. *********************************************************************
- */
- VDKAPI int VDKLANG
- vdkGetEvent(
- vdkWindow Window,
- vdkEvent * Event
- );
- /*******************************************************************************
- ** Time. ***********************************************************************
- */
- VDKAPI unsigned int VDKLANG
- vdkGetTicks(
- void
- );
- /*******************************************************************************
- ** EGL support. ****************************************************************
- */
- #include <EGL/egl.h>
- /* EGL prototypes. */
- typedef EGLDisplay (EGLAPIENTRY * EGL_GET_DISPLAY)(
- EGLNativeDisplayType display_id
- );
- typedef EGLBoolean (EGLAPIENTRY * EGL_INITIALIZE)(
- EGLDisplay dpy,
- EGLint *major,
- EGLint *minor
- );
- typedef EGLBoolean (EGLAPIENTRY * EGL_TERMINATE)(
- EGLDisplay dpy
- );
- typedef EGLBoolean (EGLAPIENTRY * EGL_CHOOSE_CONFIG)(
- EGLDisplay dpy,
- const EGLint *attrib_list,
- EGLConfig *configs,
- EGLint config_size,
- EGLint *num_config
- );
- typedef EGLSurface (EGLAPIENTRY * EGL_CREATE_WINDOW_SURFACE)(
- EGLDisplay dpy,
- EGLConfig config,
- EGLNativeWindowType win,
- const EGLint *attrib_list
- );
- typedef EGLBoolean (EGLAPIENTRY * EGL_DESTROY_SURFACE)(
- EGLDisplay dpy,
- EGLSurface surface
- );
- typedef EGLContext (EGLAPIENTRY * EGL_CREATE_CONTEXT)(
- EGLDisplay dpy,
- EGLConfig config,
- EGLContext share_context,
- const EGLint *attrib_list
- );
- typedef EGLBoolean (EGLAPIENTRY * EGL_DESTROY_CONTEXT)(
- EGLDisplay dpy,
- EGLContext ctx
- );
- typedef EGLBoolean (EGLAPIENTRY * EGL_MAKE_CURRENT)(
- EGLDisplay dpy,
- EGLSurface draw,
- EGLSurface read,
- EGLContext ctx
- );
- typedef EGLBoolean (EGLAPIENTRY * EGL_SWAP_BUFFERS)(
- EGLDisplay dpy,
- EGLSurface surface
- );
- typedef void (* EGL_PROC)(void);
- typedef EGL_PROC (EGLAPIENTRY * EGL_GET_PROC_ADDRESS)(
- const char *procname
- );
- typedef EGLBoolean (EGLAPIENTRY * EGL_BIND_API)(
- EGLenum api
- );
- /* VDK_EGL structure defining the stuff required for EGL support. */
- typedef struct _vdkEGL
- {
- /* Pointer to VDK private data. */
- vdkPrivate vdk;
- /* Pointer to vdkDisplay structure. */
- vdkDisplay display;
- /* Pointer to vdkWindow structure. */
- vdkWindow window;
- /* EGL pointers. */
- EGLDisplay eglDisplay;
- EGLConfig eglConfig;
- EGLSurface eglSurface;
- EGLContext eglContext;
- /* EGL function pointers. */
- EGL_GET_DISPLAY eglGetDisplay;
- EGL_INITIALIZE eglInitialize;
- EGL_TERMINATE eglTerminate;
- EGL_CHOOSE_CONFIG eglChooseConfig;
- EGL_CREATE_WINDOW_SURFACE eglCreateWindowSurface;
- EGL_DESTROY_SURFACE eglDestroySurface;
- EGL_CREATE_CONTEXT eglCreateContext;
- EGL_DESTROY_CONTEXT eglDestroyContext;
- EGL_MAKE_CURRENT eglMakeCurrent;
- EGL_SWAP_BUFFERS eglSwapBuffers;
- EGL_GET_PROC_ADDRESS eglGetProcAddress;
- EGL_BIND_API eglBindAPI;
- }
- vdkEGL;
- typedef void (EGLAPIENTRY * EGL_ADDRESS)(
- void);
- EGL_ADDRESS
- vdkGetAddress(
- vdkPrivate Private,
- const char * Function
- );
- #define VDK_CONFIG_RGB565_D16 ((const EGLint *) 1)
- #define VDK_CONFIG_RGB565_D24 ((const EGLint *) 3)
- #define VDK_CONFIG_RGB888_D16 ((const EGLint *) 5)
- #define VDK_CONFIG_RGB888_D24 ((const EGLint *) 7)
- #define VDK_CONFIG_RGB565_D16_AA ((const EGLint *) 9)
- #define VDK_CONFIG_RGB565_D24_AA ((const EGLint *) 11)
- #define VDK_CONFIG_RGB888_D16_AA ((const EGLint *) 13)
- #define VDK_CONFIG_RGB888_D24_AA ((const EGLint *) 15)
- /* OpenVG Configurations. */
- #define VDK_CONFIG_RGB565_VG ((const EGLint *) 500)
- #define VDK_CONFIG_RGB888_VG ((const EGLint *) 501)
- #define VDK_CONTEXT_ES11 ((const EGLint *) 0)
- #define VDK_CONTEXT_ES20 ((const EGLint *) 2)
- VDKAPI int VDKLANG
- vdkSetupEGL(
- int X,
- int Y,
- int Width,
- int Height,
- const EGLint * ConfigurationAttributes,
- const EGLint * SurfaceAttributes,
- const EGLint * ContextAttributes,
- vdkEGL * Egl
- );
- VDKAPI int VDKLANG
- vdkSwapEGL(
- vdkEGL * Egl
- );
- VDKAPI void VDKLANG
- vdkFinishEGL(
- vdkEGL * Egl
- );
- /*******************************************************************************
- ** GL Textures. ****************************************************************
- */
- typedef enum _vdkTextureType
- {
- VDK_TGA,
- VDK_PNG,
- VDK_PKM,
- }
- vdkTextureType;
- typedef enum _vdkTextureFace
- {
- VDK_2D,
- VDK_POSITIVE_X,
- VDK_NEGATIVE_X,
- VDK_POSITIVE_Y,
- VDK_NEGATIVE_Y,
- VDK_POSITIVE_Z,
- VDK_NEGATIVE_Z,
- }
- vdkTextureFace;
- VDKAPI unsigned int VDKLANG
- vdkLoadTexture(
- vdkEGL * Egl,
- const char * FileName,
- vdkTextureType Type,
- vdkTextureFace Face
- );
- /*******************************************************************************
- ** GL Shaders. *****************************************************************
- */
- VDKAPI unsigned int VDKLANG
- vdkMakeProgram(
- vdkEGL * Egl,
- const char * VertexShader,
- const char * FragmentShader,
- char ** Log
- );
- VDKAPI int VDKLANG
- vdkDeleteProgram(
- vdkEGL * Egl,
- unsigned int Program
- );
- #ifdef __cplusplus
- }
- #endif
- #endif /* __vdk_h_ */
|