Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * Copyright (C) 2010 LunarG Inc.
  3.  *
  4.  * Permission is hereby granted, free of charge, to any person obtaining a
  5.  * copy of this software and associated documentation files (the "Software"),
  6.  * to deal in the Software without restriction, including without limitation
  7.  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8.  * and/or sell copies of the Software, and to permit persons to whom the
  9.  * Software is furnished to do so, 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 Software.
  13.  *
  14.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  17.  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18.  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19.  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20.  * DEALINGS IN THE SOFTWARE.
  21.  *
  22.  * Authors:
  23.  *    Chia-I Wu <olv@lunarg.com>
  24.  */
  25.  
  26. #ifndef _EGLUTINT_H_
  27. #define _EGLUTINT_H_
  28.  
  29. #include "EGL/egl.h"
  30. #include "render.h"
  31. #include "eglut.h"
  32.  
  33.  
  34. struct eglut_window {
  35.    EGLConfig config;
  36.    EGLContext context;
  37.  
  38.    /* initialized by native display */
  39.    struct {
  40.       union {
  41.          EGLNativeWindowType window;
  42.          EGLNativePixmapType pixmap;
  43.          EGLSurface surface; /* pbuffer or screen surface */
  44.       } u;
  45.       int width, height;
  46.    } native;
  47.  
  48.    EGLSurface surface;
  49.  
  50.    int index;
  51.  
  52.    EGLUTreshapeCB reshape_cb;
  53.    EGLUTdisplayCB display_cb;
  54.    EGLUTkeyboardCB keyboard_cb;
  55.    EGLUTspecialCB special_cb;
  56. };
  57.  
  58. struct eglut_state {
  59.    int api_mask;
  60.    int window_width, window_height;
  61.    const char *display_name;
  62.    int verbose;
  63.    int init_time;
  64.  
  65.    EGLUTidleCB idle_cb;
  66.  
  67.    int num_windows;
  68.  
  69.    /* initialized by native display */
  70.    EGLNativeDisplayType native_dpy;
  71.    EGLint surface_type;
  72.  
  73.    EGLDisplay dpy;
  74.    EGLint major, minor;
  75.  
  76.    struct eglut_window *current;
  77.    struct render *render;
  78.    int redisplay;
  79. };
  80.  
  81. extern struct eglut_state *_eglut;
  82.  
  83. void
  84. _eglutFatal(char *format, ...);
  85.  
  86. int
  87. _eglutNow(void);
  88.  
  89. void
  90. _eglutNativeInitDisplay(void);
  91.  
  92. void
  93. _eglutNativeFiniDisplay(void);
  94.  
  95. void
  96. _eglutNativeInitWindow(struct eglut_window *win, const char *title,
  97.                        int x, int y, int w, int h);
  98.  
  99. void
  100. _eglutNativeFiniWindow(struct eglut_window *win);
  101.  
  102. void
  103. _eglutNativeEventLoop(void);
  104.  
  105. #endif /* _EGLUTINT_H_ */
  106.