hostsupport/hostegl/inc/eglDefinitions.h
branchbug235_bringup_0
changeset 53 c2ef9095503a
child 56 40cc73c24bf8
equal deleted inserted replaced
52:39e5f73667ba 53:c2ef9095503a
       
     1 /* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     2  *
       
     3  * Permission is hereby granted, free of charge, to any person obtaining a
       
     4  * copy of this software and /or associated documentation files
       
     5  * (the "Materials "), to deal in the Materials without restriction,
       
     6  * including without limitation the rights to use, copy, modify, merge,
       
     7  * publish, distribute, sublicense, and/or sell copies of the Materials,
       
     8  * and to permit persons to whom the Materials are furnished to do so,
       
     9  * subject to the following conditions:
       
    10  *
       
    11  * The above copyright notice and this permission notice shall be included
       
    12  * in all copies or substantial portions of the Materials.
       
    13  *
       
    14  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
       
    15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
       
    16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
       
    17  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
       
    18  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
       
    19  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
       
    20  * THE USE OR OTHER DEALINGS IN THE MATERIALS.
       
    21  *
       
    22  * Initial Contributors:
       
    23  * Nokia Corporation - initial contribution.
       
    24  *
       
    25  * Contributors:
       
    26  *
       
    27  * Description:
       
    28  *
       
    29  */
       
    30 
       
    31 #ifndef _EGLDEFINITIONS_H_
       
    32 #define _EGLDEFINITIONS_H_
       
    33 
       
    34 #if defined(_WIN32)
       
    35 #include <windows.h>
       
    36 #include <GL\gl.h>
       
    37 #include <GL\wglext.h>
       
    38 #else // Linux
       
    39 #include <X11/Xlib.h>
       
    40 #include <X11/Xutil.h>
       
    41 #include <GL/glx.h>
       
    42 #include <GL/glxext.h>
       
    43 #include <assert.h>
       
    44 #endif
       
    45 
       
    46 #define EGL_VERSION_MAJOR 1
       
    47 #define EGL_VERSION_MINOR 4
       
    48 
       
    49 #define EGLI_NEW new(std::nothrow)
       
    50 
       
    51 #define EGLI_NO_RET
       
    52 
       
    53 // \note PlatSim specific hack
       
    54 #if defined(EGLI_USE_PLATSIM_EXTENSIONS)
       
    55     typedef int     EGLINativeDisplayType;
       
    56     typedef void*   EGLINativePixmapType;
       
    57     typedef void*   EGLINativeWindowType;
       
    58 #else
       
    59     typedef EGLNativeDisplayType    EGLINativeDisplayType;
       
    60     typedef EGLNativePixmapType     EGLINativePixmapType;
       
    61     typedef EGLNativeWindowType     EGLINativeWindowType;
       
    62 #endif
       
    63 
       
    64 #if !defined(EGLI_MIN)
       
    65 #   define EGLI_MIN(a,b) ((a)<(b)?(a):(b))
       
    66 #endif
       
    67 
       
    68 #if !defined(EGLI_MAX)
       
    69 #   define EGLI_MAX(a,b) ((a)>(b)?(a):(b))
       
    70 #endif
       
    71 
       
    72 #if defined(_WIN32)
       
    73 #   if defined(_DEBUG)
       
    74 #       define EGLI_ASSERT assert
       
    75 #   else
       
    76 #      define EGLI_ASSERT
       
    77 #   endif //_DEBUG
       
    78 #else
       
    79 #   if !defined(NDEBUG)
       
    80 #       define EGLI_ASSERT assert
       
    81 #   else
       
    82 #       define EGLI_ASSERT
       
    83 #   endif
       
    84 #endif
       
    85 
       
    86 #if defined(_WIN32)
       
    87 
       
    88 #if defined(EGLI_USE_PLATSIM_EXTENSIONS)
       
    89 #   define EGLI_THREAD_ID EGLint
       
    90 #else
       
    91 #   define EGLI_THREAD_ID DWORD
       
    92 #endif // EGLI_USE_PLATSIM_EXTENSIONS
       
    93     typedef CRITICAL_SECTION        EGLI_LOCK;
       
    94     typedef HGLRC                   EGLINativeContextType;
       
    95     typedef HPBUFFERARB             EGLINativePbufferType;
       
    96     typedef PIXELFORMATDESCRIPTOR   EGLINativePixelFormatType;
       
    97     typedef HMODULE                 EGLILibraryHandle;
       
    98 #else // Linux
       
    99 
       
   100 #if defined(EGLI_USE_PLATSIM_EXTENSIONS)
       
   101 #   define EGLI_THREAD_ID EGLint
       
   102 #else
       
   103 #   define EGLI_THREAD_ID pid_t
       
   104 #endif // EGLI_USE_PLATSIM_EXTENSIONS
       
   105     typedef pthread_mutex_t EGLI_LOCK;
       
   106     typedef GLXContext      EGLINativeContextType;
       
   107     typedef GLXPbuffer      EGLINativePbufferType;
       
   108     typedef XVisualInfo     EGLINativePixelFormatType;
       
   109     typedef void*           EGLILibraryHandle;
       
   110 
       
   111 #endif
       
   112 
       
   113 
       
   114 #endif // _EGLDEFINITIONS_H_