File: gl4es_init.cpp

package info (click to toggle)
openmw 0.49.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,992 kB
  • sloc: cpp: 372,479; xml: 2,149; sh: 1,403; python: 797; makefile: 26
file content (37 lines) | stat: -rw-r--r-- 876 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// EGL does not work reliably for feature detection.
// Instead, we initialize gl4es manually.
#ifdef OPENMW_GL4ES_MANUAL_INIT
#include "gl4es_init.h"

// For glHint
#include <GL/gl.h>

extern "C"
{

#include <gl4es/gl4eshint.h>
#include <gl4es/gl4esinit.h>

    static SDL_Window* gWindow;

    void openmw_gl4es_GetMainFBSize(int* width, int* height)
    {
        SDL_GetWindowSize(gWindow, width, height);
    }

    void openmw_gl4es_init(SDL_Window* window)
    {
        gWindow = window;
        set_getprocaddress(SDL_GL_GetProcAddress);
        set_getmainfbsize(openmw_gl4es_GetMainFBSize);
        initialize_gl4es();

        // merge glBegin/glEnd in beams and console
        glHint(GL_BEGINEND_HINT_GL4ES, 1);
        // dxt unpacked to 16-bit looks ugly
        glHint(GL_AVOID16BITS_HINT_GL4ES, 1);
    }

} // extern "C"

#endif // OPENMW_GL4ES_MANUAL_INIT