Mercurial > touhou
annotate pytouhou/lib/_sdl.pxd @ 612:73f134f84c7f
Request a RGB888 context, since SDL2’s default of RGB332 sucks.
On X11/GLX, it will select the first config available, that is the best
one, while on EGL it will iterate over them to select the one closest
to what the application requested.
Of course, anything lower than RGB888 looks bad and we really don’t
want that.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Thu, 26 Mar 2015 20:20:37 +0100 |
parents | 19d930f9e3f0 |
children | 80687f258001 |
rev | line source |
---|---|
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
1 # -*- encoding: utf-8 -*- |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
2 ## |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
3 ## Copyright (C) 2013 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
4 ## |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
5 ## This program is free software; you can redistribute it and/or modify |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
6 ## it under the terms of the GNU General Public License as published |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
7 ## by the Free Software Foundation; version 3 only. |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
8 ## |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
9 ## This program is distributed in the hope that it will be useful, |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
12 ## GNU General Public License for more details. |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
13 ## |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
14 |
455
6864a38b2413
Make pytouhou.lib.sdl cimportable, and convert pytouhou.ui.window.* to extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
15 cdef extern from "SDL.h" nogil: |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
16 ctypedef unsigned int Uint32 |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
17 ctypedef unsigned short Uint16 |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
18 ctypedef unsigned char Uint8 |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
19 |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
20 int SDL_INIT_VIDEO |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
21 |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
22 int SDL_Init(Uint32 flags) |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
23 void SDL_Quit() |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
24 |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
25 |
450
2a352118c55a
Add back Windows support, using GLEW for OpenGL.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
422
diff
changeset
|
26 IF UNAME_SYSNAME == "Windows": |
455
6864a38b2413
Make pytouhou.lib.sdl cimportable, and convert pytouhou.ui.window.* to extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
27 cdef extern from "SDL_main.h" nogil: |
450
2a352118c55a
Add back Windows support, using GLEW for OpenGL.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
422
diff
changeset
|
28 void SDL_SetMainReady() |
2a352118c55a
Add back Windows support, using GLEW for OpenGL.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
422
diff
changeset
|
29 |
2a352118c55a
Add back Windows support, using GLEW for OpenGL.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
422
diff
changeset
|
30 |
455
6864a38b2413
Make pytouhou.lib.sdl cimportable, and convert pytouhou.ui.window.* to extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
31 cdef extern from "SDL_error.h" nogil: |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
32 const char *SDL_GetError() |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
33 |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
34 |
455
6864a38b2413
Make pytouhou.lib.sdl cimportable, and convert pytouhou.ui.window.* to extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
35 cdef extern from "SDL_video.h" nogil: |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
36 ctypedef enum SDL_GLattr: |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
37 SDL_GL_CONTEXT_MAJOR_VERSION |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
38 SDL_GL_CONTEXT_MINOR_VERSION |
556
c34b23e29d16
Make the OpenGL flavor and version options work.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
531
diff
changeset
|
39 SDL_GL_CONTEXT_PROFILE_MASK |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
40 SDL_GL_DOUBLEBUFFER |
612
73f134f84c7f
Request a RGB888 context, since SDL2’s default of RGB332 sucks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
592
diff
changeset
|
41 SDL_GL_RED_SIZE |
73f134f84c7f
Request a RGB888 context, since SDL2’s default of RGB332 sucks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
592
diff
changeset
|
42 SDL_GL_GREEN_SIZE |
73f134f84c7f
Request a RGB888 context, since SDL2’s default of RGB332 sucks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
592
diff
changeset
|
43 SDL_GL_BLUE_SIZE |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
44 SDL_GL_DEPTH_SIZE |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
45 |
556
c34b23e29d16
Make the OpenGL flavor and version options work.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
531
diff
changeset
|
46 ctypedef enum SDL_GLprofile: |
c34b23e29d16
Make the OpenGL flavor and version options work.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
531
diff
changeset
|
47 SDL_GL_CONTEXT_PROFILE_CORE |
c34b23e29d16
Make the OpenGL flavor and version options work.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
531
diff
changeset
|
48 SDL_GL_CONTEXT_PROFILE_COMPATIBILITY |
c34b23e29d16
Make the OpenGL flavor and version options work.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
531
diff
changeset
|
49 SDL_GL_CONTEXT_PROFILE_ES |
c34b23e29d16
Make the OpenGL flavor and version options work.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
531
diff
changeset
|
50 |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
51 ctypedef enum SDL_WindowFlags: |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
52 SDL_WINDOWPOS_CENTERED |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
53 SDL_WINDOW_OPENGL |
464
36bc577b2392
Make the window resizable, and scale its content correctly.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
456
diff
changeset
|
54 SDL_WINDOW_RESIZABLE |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
55 |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
56 ctypedef struct SDL_Window: |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
57 pass |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
58 |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
59 ctypedef void *SDL_GLContext |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
60 |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
61 int SDL_GL_SetAttribute(SDL_GLattr attr, int value) |
589
0768122da817
Add a frameskip option, and use swap interval to implement it.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
556
diff
changeset
|
62 int SDL_GL_SetSwapInterval(int interval) |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
63 SDL_Window *SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
64 SDL_GLContext SDL_GL_CreateContext(SDL_Window *window) |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
65 void SDL_GL_SwapWindow(SDL_Window *window) |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
66 void SDL_GL_DeleteContext(SDL_GLContext context) |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
67 void SDL_DestroyWindow(SDL_Window *window) |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
68 |
422
52829ebe2561
Refactor window management in its own class.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
421
diff
changeset
|
69 void SDL_SetWindowSize(SDL_Window *window, int w, int h) |
52829ebe2561
Refactor window management in its own class.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
421
diff
changeset
|
70 |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
71 |
455
6864a38b2413
Make pytouhou.lib.sdl cimportable, and convert pytouhou.ui.window.* to extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
72 cdef extern from "SDL_scancode.h" nogil: |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
73 ctypedef enum SDL_Scancode: |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
74 SDL_SCANCODE_Z |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
75 SDL_SCANCODE_X |
592
19d930f9e3f0
Add the screenshot feature, using P or Home like the original game.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
589
diff
changeset
|
76 SDL_SCANCODE_P |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
77 SDL_SCANCODE_LSHIFT |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
78 SDL_SCANCODE_UP |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
79 SDL_SCANCODE_DOWN |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
80 SDL_SCANCODE_LEFT |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
81 SDL_SCANCODE_RIGHT |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
82 SDL_SCANCODE_LCTRL |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
83 SDL_SCANCODE_ESCAPE |
592
19d930f9e3f0
Add the screenshot feature, using P or Home like the original game.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
589
diff
changeset
|
84 SDL_SCANCODE_HOME |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
85 |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
86 |
455
6864a38b2413
Make pytouhou.lib.sdl cimportable, and convert pytouhou.ui.window.* to extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
87 cdef extern from "SDL_events.h" nogil: |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
88 ctypedef enum SDL_EventType: |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
89 SDL_KEYDOWN |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
90 SDL_QUIT |
464
36bc577b2392
Make the window resizable, and scale its content correctly.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
456
diff
changeset
|
91 SDL_WINDOWEVENT |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
92 |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
93 ctypedef struct SDL_Keysym: |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
94 SDL_Scancode scancode |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
95 |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
96 ctypedef struct SDL_KeyboardEvent: |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
97 Uint32 type |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
98 SDL_Keysym keysym |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
99 |
464
36bc577b2392
Make the window resizable, and scale its content correctly.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
456
diff
changeset
|
100 ctypedef enum SDL_WindowEventID: |
36bc577b2392
Make the window resizable, and scale its content correctly.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
456
diff
changeset
|
101 SDL_WINDOWEVENT_RESIZED |
36bc577b2392
Make the window resizable, and scale its content correctly.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
456
diff
changeset
|
102 |
36bc577b2392
Make the window resizable, and scale its content correctly.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
456
diff
changeset
|
103 ctypedef struct SDL_WindowEvent: |
36bc577b2392
Make the window resizable, and scale its content correctly.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
456
diff
changeset
|
104 Uint32 type |
36bc577b2392
Make the window resizable, and scale its content correctly.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
456
diff
changeset
|
105 SDL_WindowEventID event |
36bc577b2392
Make the window resizable, and scale its content correctly.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
456
diff
changeset
|
106 int data1 |
36bc577b2392
Make the window resizable, and scale its content correctly.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
456
diff
changeset
|
107 int data2 |
36bc577b2392
Make the window resizable, and scale its content correctly.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
456
diff
changeset
|
108 |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
109 ctypedef union SDL_Event: |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
110 Uint32 type |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
111 SDL_KeyboardEvent key |
464
36bc577b2392
Make the window resizable, and scale its content correctly.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
456
diff
changeset
|
112 SDL_WindowEvent window |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
113 |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
114 int SDL_PollEvent(SDL_Event *event) |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
115 |
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
116 |
455
6864a38b2413
Make pytouhou.lib.sdl cimportable, and convert pytouhou.ui.window.* to extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
117 cdef extern from "SDL_keyboard.h" nogil: |
418
63f59be04a54
Replace Pyglet with SDL2 for window creation and events; disables framerate control/display and sound.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
118 const Uint8 *SDL_GetKeyboardState(int *numkeys) |
419
1c92721f8e49
Re-implement frame control
Thibaut Girka <thib@sitedethib.com>
parents:
418
diff
changeset
|
119 |
1c92721f8e49
Re-implement frame control
Thibaut Girka <thib@sitedethib.com>
parents:
418
diff
changeset
|
120 |
455
6864a38b2413
Make pytouhou.lib.sdl cimportable, and convert pytouhou.ui.window.* to extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
121 cdef extern from "SDL_timer.h" nogil: |
419
1c92721f8e49
Re-implement frame control
Thibaut Girka <thib@sitedethib.com>
parents:
418
diff
changeset
|
122 Uint32 SDL_GetTicks() |
1c92721f8e49
Re-implement frame control
Thibaut Girka <thib@sitedethib.com>
parents:
418
diff
changeset
|
123 void SDL_Delay(Uint32 ms) |
420
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
124 |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
125 |
455
6864a38b2413
Make pytouhou.lib.sdl cimportable, and convert pytouhou.ui.window.* to extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
126 cdef extern from "SDL_rect.h" nogil: |
420
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
127 ctypedef struct SDL_Rect: |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
128 int x, y |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
129 int w, h |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
130 |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
131 |
455
6864a38b2413
Make pytouhou.lib.sdl cimportable, and convert pytouhou.ui.window.* to extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
132 cdef extern from "SDL_surface.h" nogil: |
420
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
133 ctypedef struct SDL_Surface: |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
134 int w, h |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
135 unsigned char *pixels |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
136 |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
137 void SDL_FreeSurface(SDL_Surface *surface) |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
138 int SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
139 SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
140 |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
141 |
455
6864a38b2413
Make pytouhou.lib.sdl cimportable, and convert pytouhou.ui.window.* to extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
142 cdef extern from "SDL_rwops.h" nogil: |
420
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
143 ctypedef struct SDL_RWops: |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
144 pass |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
145 |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
146 SDL_RWops *SDL_RWFromConstMem(const void *mem, int size) |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
147 int SDL_RWclose(SDL_RWops *context) |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
148 |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
149 |
455
6864a38b2413
Make pytouhou.lib.sdl cimportable, and convert pytouhou.ui.window.* to extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
150 cdef extern from "SDL_image.h" nogil: |
420
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
151 int IMG_INIT_PNG |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
152 |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
153 int IMG_Init(int flags) |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
154 void IMG_Quit() |
3a7b36324611
Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
419
diff
changeset
|
155 SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src) |
421
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
156 |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
157 |
455
6864a38b2413
Make pytouhou.lib.sdl cimportable, and convert pytouhou.ui.window.* to extension types.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
450
diff
changeset
|
158 cdef extern from "SDL_mixer.h" nogil: |
421
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
159 ctypedef enum: |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
160 MIX_DEFAULT_FORMAT |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
161 |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
162 ctypedef struct Mix_Music: |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
163 pass |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
164 |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
165 ctypedef struct Mix_Chunk: |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
166 pass |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
167 |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
168 int Mix_Init(int flags) |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
169 void Mix_Quit() |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
170 |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
171 int Mix_OpenAudio(int frequency, Uint16 format_, int channels, int chunksize) |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
172 void Mix_CloseAudio() |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
173 |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
174 int Mix_AllocateChannels(int numchans) |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
175 |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
176 Mix_Music *Mix_LoadMUS(const char *filename) |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
177 Mix_Chunk *Mix_LoadWAV_RW(SDL_RWops *src, int freesrc) |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
178 |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
179 void Mix_FreeMusic(Mix_Music *music) |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
180 void Mix_FreeChunk(Mix_Chunk *chunk) |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
181 |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
182 int Mix_PlayMusic(Mix_Music *music, int loops) |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
183 #int Mix_SetLoopPoints(Mix_Music *music, double start, double end) |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
184 |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
185 int Mix_Volume(int channel, int volume) |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
186 int Mix_VolumeChunk(Mix_Chunk *chunk, int volume) |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
187 int Mix_VolumeMusic(int volume) |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
188 |
b1248bab2d0f
Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
420
diff
changeset
|
189 int Mix_PlayChannel(int channel, Mix_Chunk *chunk, int loops) |
456
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
190 |
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
191 |
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
192 cdef extern from "SDL_pixels.h" nogil: |
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
193 ctypedef struct SDL_Color: |
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
194 Uint8 r, g, b, a |
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
195 |
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
196 |
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
197 cdef extern from "SDL_ttf.h" nogil: |
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
198 ctypedef struct TTF_Font: |
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
199 pass |
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
200 |
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
201 int TTF_Init() |
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
202 void TTF_Quit() |
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
203 TTF_Font *TTF_OpenFont(const char *filename, int ptsize) |
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
204 void TTF_CloseFont(TTF_Font *font) |
cae1ae9de430
Add native text support, MSG instructions 3 and 8, and text at the beginning of a stage.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
455
diff
changeset
|
205 SDL_Surface *TTF_RenderUTF8_Blended(TTF_Font *font, const char *text, SDL_Color fg) |
512
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
206 |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
207 |
531
a7dc55ad9380
Display important messages in popups, instead of the terminal.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
512
diff
changeset
|
208 cdef extern from "SDL_messagebox.h" nogil: |
a7dc55ad9380
Display important messages in popups, instead of the terminal.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
512
diff
changeset
|
209 int SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window) |
a7dc55ad9380
Display important messages in popups, instead of the terminal.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
512
diff
changeset
|
210 |
a7dc55ad9380
Display important messages in popups, instead of the terminal.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
512
diff
changeset
|
211 |
512
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
212 cdef extern from "SDL_blendmode.h" nogil: |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
213 ctypedef enum SDL_BlendMode: |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
214 SDL_BLENDMODE_NONE |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
215 SDL_BLENDMODE_BLEND |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
216 SDL_BLENDMODE_ADD |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
217 SDL_BLENDMODE_MOD |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
218 |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
219 |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
220 cdef extern from "SDL_render.h" nogil: |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
221 ctypedef struct SDL_Renderer: |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
222 pass |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
223 |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
224 ctypedef struct SDL_Texture: |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
225 pass |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
226 |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
227 ctypedef struct SDL_Point: |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
228 pass |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
229 |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
230 SDL_Renderer *SDL_CreateRenderer(SDL_Window *window, int index, Uint32 flags) |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
231 void SDL_RenderPresent(SDL_Renderer *renderer) |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
232 int SDL_RenderClear(SDL_Renderer *renderer) |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
233 SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface) |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
234 int SDL_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_Rect *dstrect) |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
235 int SDL_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_Rect *dstrect, double angle, const SDL_Point *center, bint flip) |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
236 int SDL_RenderSetClipRect(SDL_Renderer *renderer, const SDL_Rect *rect) |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
237 int SDL_RenderSetViewport(SDL_Renderer *renderer, const SDL_Rect *rect) |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
238 |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
239 int SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b) |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
240 int SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha) |
b39ad30c6620
Add a pure SDL backend.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
464
diff
changeset
|
241 int SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blend_mode) |