summaryrefslogtreecommitdiff
path: root/src/sdl_context.hpp
blob: 7b96df7e6bfa9936b180736e6822fce731679785 (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
#ifndef SDL_CONTEXT_HPP
#define SDL_CONTEXT_HPP

#include <SDL.h>

namespace bookmouse {

class SdlContext {
  public:
    SdlContext() noexcept(false);
    ~SdlContext();

    int setAttribute(SDL_GLattr attr, int value) const;

    consteval const char* glslVersion()
    {
#if defined(IMGUI_IMPL_OPENGL_ES2)
        // GL ES 2.0 + GLSL 100
        return "#version 100";
#elif defined(__APPLE__)
        // GL 3.2 Core + GLSL 150
        return "#version 150";
#else
        // GL 3.0 + GLSL 130
        return "#version 130";
#endif
    }

  private:
};

} // namespace bookmouse

#endif