Welcome to mirror list, hosted at ThFree Co, Russian Federation.

opengl.hpp « internal « yg - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0603585bd87ca2d7eb338cf834beb95d76b8d93e (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include "../../std/target_os.hpp"

#if defined(OMIM_OS_WINDOWS)
  #include "opengl_win32.hpp"

#elif defined(OMIM_OS_BADA)
  #include <FGraphicsOpengl.h>
  using namespace Osp::Graphics::Opengl;
  #define OMIM_GL_ES

#elif (defined(OMIM_OS_MAC) || defined(OMIM_OS_IPHONE))
  #include <TargetConditionals.h>

  #ifdef OMIM_OS_IPHONE
    #define USE_OPENGLES20_IF_AVAILABLE 0
    #include <OpenGLES/ES1/gl.h>
    #include <OpenGLES/ES1/glext.h>
    #define OMIM_GL_ES
  #else
    #include <OpenGL/gl.h>
    #include <OpenGL/glext.h>
  #endif
#else
  #define GL_GLEXT_PROTOTYPES
  #include <GL/gl.h>
  #include <GL/glext.h>
#endif

#include "../../base/src_point.hpp"

namespace yg
{
  namespace gl
  {
    extern bool g_isBufferObjectsSupported;
    extern bool g_isFramebufferSupported;
    extern bool g_isRenderbufferSupported;
    extern bool g_isMultisamplingSupported;

    /// return false to terminate program
    bool CheckExtensionSupport();

    void CheckError(my::SrcPoint const & srcPt);
    void CheckEGLError(my::SrcPoint const & srcPt);
  }
}

#ifdef DEBUG
#define OGLCHECK(f) do {f; yg::gl::CheckError(SRC());} while(false)
#define OGLCHECKAFTER yg::gl::CheckError(SRC())
#define EGLCHECK do {yg::gl::CheckEGLError(SRC());} while(false)
#else
#define OGLCHECK(f) f
#define OGLCHECKAFTER
#define EGLCHECK
#endif