Conditions | 2 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
1 | import sdl2 as sdl |
||
5 | def __init__(self, major, minor, msaa): |
||
6 | self.major = major |
||
7 | self.minor = minor |
||
8 | self.msaa = msaa |
||
9 | |||
10 | self.profile = sdl.SDL_GL_CONTEXT_PROFILE_CORE |
||
11 | |||
12 | self.context = None |
||
13 | self._window = None |
||
14 | |||
15 | sdl.SDL_GL_SetAttribute(sdl.SDL_GL_DOUBLEBUFFER, 1) |
||
16 | |||
17 | sdl.SDL_GL_SetAttribute(sdl.SDL_GL_CONTEXT_MAJOR_VERSION, self.major) |
||
18 | sdl.SDL_GL_SetAttribute(sdl.SDL_GL_CONTEXT_MINOR_VERSION, self.minor) |
||
19 | |||
20 | sdl.SDL_GL_SetAttribute(sdl.SDL_GL_CONTEXT_PROFILE_MASK, self.profile) |
||
21 | |||
22 | if self.msaa < 0: |
||
23 | sdl.SDL_GL_SetAttribute(sdl.SDL_GL_MULTISAMPLEBUFFERS, 1) |
||
24 | sdl.SDL_GL_SetAttribute(sdl.SDL_GL_MULTISAMPLESAMPLES, self.msaa) |
||
25 | |||
43 |