… | |
… | |
663 | SDL_GL_SwapBuffers () |
663 | SDL_GL_SwapBuffers () |
664 | |
664 | |
665 | char * |
665 | char * |
666 | SDL_GetKeyName (int sym) |
666 | SDL_GetKeyName (int sym) |
667 | |
667 | |
|
|
668 | int |
|
|
669 | SDL_GetAppState () |
|
|
670 | |
668 | void |
671 | void |
669 | SDL_PollEvent () |
672 | poll_events () |
670 | PPCODE: |
673 | PPCODE: |
671 | { |
674 | { |
672 | SDL_Event ev; |
675 | SDL_Event ev; |
673 | |
676 | |
674 | while (SDL_PollEvent (&ev)) |
677 | SDL_PumpEvents (); |
|
|
678 | while (SDL_PeepEvents (&ev, 1, SDL_GETEVENT, SDL_ALLEVENTS) > 0) |
675 | { |
679 | { |
676 | HV *hv = newHV (); |
680 | HV *hv = newHV (); |
677 | hv_store (hv, "type", 4, newSViv (ev.type), 0); |
681 | hv_store (hv, "type", 4, newSViv (ev.type), 0); |
678 | |
682 | |
679 | switch (ev.type) |
683 | switch (ev.type) |
… | |
… | |
691 | hv_store (hv, "gain", 4, newSViv (ev.active.gain), 0); |
695 | hv_store (hv, "gain", 4, newSViv (ev.active.gain), 0); |
692 | hv_store (hv, "state", 5, newSViv (ev.active.state), 0); |
696 | hv_store (hv, "state", 5, newSViv (ev.active.state), 0); |
693 | break; |
697 | break; |
694 | |
698 | |
695 | case SDL_MOUSEMOTION: |
699 | case SDL_MOUSEMOTION: |
|
|
700 | { |
|
|
701 | int state = ev.motion.state; |
|
|
702 | int x = ev.motion.x; |
|
|
703 | int y = ev.motion.y; |
|
|
704 | int xrel = ev.motion.xrel; |
|
|
705 | int yrel = ev.motion.yrel; |
|
|
706 | |
|
|
707 | /* do simplistic event compression */ |
|
|
708 | while (SDL_PeepEvents (&ev, 1, SDL_PEEKEVENT, SDL_EVENTMASK (SDL_MOUSEMOTION)) > 0 |
|
|
709 | && state == ev.motion.state) |
|
|
710 | { |
|
|
711 | xrel += ev.motion.xrel; |
|
|
712 | yrel += ev.motion.yrel; |
|
|
713 | x = ev.motion.x; |
|
|
714 | y = ev.motion.y; |
|
|
715 | SDL_PeepEvents (&ev, 1, SDL_GETEVENT, SDL_EVENTMASK (SDL_MOUSEMOTION)); |
|
|
716 | } |
|
|
717 | |
696 | hv_store (hv, "mod", 3, newSViv (SDL_GetModState ()), 0); |
718 | hv_store (hv, "mod", 3, newSViv (SDL_GetModState ()), 0); |
697 | |
|
|
698 | hv_store (hv, "state", 5, newSViv (ev.motion.state), 0); |
719 | hv_store (hv, "state", 5, newSViv (state), 0); |
699 | hv_store (hv, "x", 1, newSViv (ev.motion.x), 0); |
720 | hv_store (hv, "x", 1, newSViv (x), 0); |
700 | hv_store (hv, "y", 1, newSViv (ev.motion.y), 0); |
721 | hv_store (hv, "y", 1, newSViv (y), 0); |
701 | hv_store (hv, "xrel", 4, newSViv (ev.motion.xrel), 0); |
722 | hv_store (hv, "xrel", 4, newSViv (xrel), 0); |
702 | hv_store (hv, "yrel", 4, newSViv (ev.motion.yrel), 0); |
723 | hv_store (hv, "yrel", 4, newSViv (yrel), 0); |
|
|
724 | } |
703 | break; |
725 | break; |
704 | |
726 | |
705 | case SDL_MOUSEBUTTONDOWN: |
727 | case SDL_MOUSEBUTTONDOWN: |
706 | case SDL_MOUSEBUTTONUP: |
728 | case SDL_MOUSEBUTTONUP: |
707 | hv_store (hv, "mod", 3, newSViv (SDL_GetModState ()), 0); |
729 | hv_store (hv, "mod", 3, newSViv (SDL_GetModState ()), 0); |
… | |
… | |
1220 | flags |
1242 | flags |
1221 | ); |
1243 | ); |
1222 | |
1244 | |
1223 | MODULE = CFPlus PACKAGE = CFPlus::Texture |
1245 | MODULE = CFPlus PACKAGE = CFPlus::Texture |
1224 | |
1246 | |
|
|
1247 | int minpot (int n) |
|
|
1248 | |
1225 | void |
1249 | void |
1226 | pad2pot (SV *data_, SV *w_, SV *h_) |
1250 | pad2pot (SV *data_, SV *w_, SV *h_) |
1227 | CODE: |
1251 | CODE: |
1228 | { |
1252 | { |
1229 | int ow = SvIV (w_); |
1253 | int ow = SvIV (w_); |
… | |
… | |
1305 | { |
1329 | { |
1306 | glDisable (GL_ALPHA_TEST); |
1330 | glDisable (GL_ALPHA_TEST); |
1307 | glDisable (GL_BLEND); |
1331 | glDisable (GL_BLEND); |
1308 | } |
1332 | } |
1309 | } |
1333 | } |
|
|
1334 | |
|
|
1335 | IV texture_valid_2d (GLint internalformat, GLsizei w, GLsizei h, GLenum format, GLenum type) |
|
|
1336 | CODE: |
|
|
1337 | { |
|
|
1338 | GLint width; |
|
|
1339 | glTexImage2D (GL_PROXY_TEXTURE_2D, 0, internalformat, w, h, 0, format, type, 0); |
|
|
1340 | glGetTexLevelParameteriv (GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width); |
|
|
1341 | RETVAL = width > 0; |
|
|
1342 | } |
|
|
1343 | OUTPUT: |
|
|
1344 | RETVAL |
1310 | |
1345 | |
1311 | MODULE = CFPlus PACKAGE = CFPlus::Map |
1346 | MODULE = CFPlus PACKAGE = CFPlus::Map |
1312 | |
1347 | |
1313 | CFPlus::Map |
1348 | CFPlus::Map |
1314 | new (SV *class) |
1349 | new (SV *class) |
… | |
… | |
2140 | CODE: |
2175 | CODE: |
2141 | RETVAL = Mix_VolumeMusic (volume); |
2176 | RETVAL = Mix_VolumeMusic (volume); |
2142 | OUTPUT: |
2177 | OUTPUT: |
2143 | RETVAL |
2178 | RETVAL |
2144 | |
2179 | |
|
|
2180 | int |
|
|
2181 | fade_out (int ms) |
|
|
2182 | CODE: |
|
|
2183 | RETVAL = Mix_FadeOutMusic (ms); |
|
|
2184 | OUTPUT: |
|
|
2185 | RETVAL |
|
|
2186 | |
2145 | CFPlus::MixMusic |
2187 | CFPlus::MixMusic |
2146 | new_from_file (SV *class, char *path) |
2188 | new_from_file (SV *class, char *path) |
2147 | CODE: |
2189 | CODE: |
2148 | RETVAL = Mix_LoadMUS (path); |
2190 | RETVAL = Mix_LoadMUS (path); |
2149 | OUTPUT: |
2191 | OUTPUT: |
… | |
… | |
2156 | |
2198 | |
2157 | int |
2199 | int |
2158 | play (CFPlus::MixMusic self, int loops = -1) |
2200 | play (CFPlus::MixMusic self, int loops = -1) |
2159 | CODE: |
2201 | CODE: |
2160 | RETVAL = Mix_PlayMusic (self, loops); |
2202 | RETVAL = Mix_PlayMusic (self, loops); |
|
|
2203 | OUTPUT: |
|
|
2204 | RETVAL |
|
|
2205 | |
|
|
2206 | int |
|
|
2207 | fade_in_pos (CFPlus::MixMusic self, int loops, int ms, double position) |
|
|
2208 | CODE: |
|
|
2209 | RETVAL = Mix_FadeInMusicPos (self, loops, ms, position); |
2161 | OUTPUT: |
2210 | OUTPUT: |
2162 | RETVAL |
2211 | RETVAL |
2163 | |
2212 | |
2164 | MODULE = CFPlus PACKAGE = CFPlus::OpenGL |
2213 | MODULE = CFPlus PACKAGE = CFPlus::OpenGL |
2165 | |
2214 | |
… | |
… | |
2169 | static const struct { |
2218 | static const struct { |
2170 | const char *name; |
2219 | const char *name; |
2171 | IV iv; |
2220 | IV iv; |
2172 | } *civ, const_iv[] = { |
2221 | } *civ, const_iv[] = { |
2173 | # define const_iv(name) { # name, (IV)name } |
2222 | # define const_iv(name) { # name, (IV)name } |
|
|
2223 | const_iv (GL_VENDOR), |
|
|
2224 | const_iv (GL_VERSION), |
|
|
2225 | const_iv (GL_EXTENSIONS), |
2174 | const_iv (GL_COLOR_MATERIAL), |
2226 | const_iv (GL_COLOR_MATERIAL), |
2175 | const_iv (GL_SMOOTH), |
2227 | const_iv (GL_SMOOTH), |
2176 | const_iv (GL_FLAT), |
2228 | const_iv (GL_FLAT), |
2177 | const_iv (GL_DITHER), |
2229 | const_iv (GL_DITHER), |
2178 | const_iv (GL_BLEND), |
2230 | const_iv (GL_BLEND), |
… | |
… | |
2205 | const_iv (GL_LUMINANCE), |
2257 | const_iv (GL_LUMINANCE), |
2206 | const_iv (GL_LUMINANCE_ALPHA), |
2258 | const_iv (GL_LUMINANCE_ALPHA), |
2207 | const_iv (GL_FLOAT), |
2259 | const_iv (GL_FLOAT), |
2208 | const_iv (GL_UNSIGNED_INT_8_8_8_8_REV), |
2260 | const_iv (GL_UNSIGNED_INT_8_8_8_8_REV), |
2209 | const_iv (GL_COMPILE), |
2261 | const_iv (GL_COMPILE), |
|
|
2262 | const_iv (GL_PROXY_TEXTURE_1D), |
|
|
2263 | const_iv (GL_PROXY_TEXTURE_2D), |
2210 | const_iv (GL_TEXTURE_1D), |
2264 | const_iv (GL_TEXTURE_1D), |
2211 | const_iv (GL_TEXTURE_2D), |
2265 | const_iv (GL_TEXTURE_2D), |
2212 | const_iv (GL_TEXTURE_ENV), |
2266 | const_iv (GL_TEXTURE_ENV), |
2213 | const_iv (GL_TEXTURE_MAG_FILTER), |
2267 | const_iv (GL_TEXTURE_MAG_FILTER), |
2214 | const_iv (GL_TEXTURE_MIN_FILTER), |
2268 | const_iv (GL_TEXTURE_MIN_FILTER), |
… | |
… | |
2280 | CODE: |
2334 | CODE: |
2281 | RETVAL = (char *)glGetString (GL_EXTENSIONS); |
2335 | RETVAL = (char *)glGetString (GL_EXTENSIONS); |
2282 | OUTPUT: |
2336 | OUTPUT: |
2283 | RETVAL |
2337 | RETVAL |
2284 | |
2338 | |
|
|
2339 | char *glGetString (GLenum pname) |
|
|
2340 | |
|
|
2341 | GLint glGetInteger (GLenum pname) |
|
|
2342 | CODE: |
|
|
2343 | glGetIntegerv (pname, &RETVAL); |
|
|
2344 | OUTPUT: |
|
|
2345 | RETVAL |
|
|
2346 | |
|
|
2347 | GLdouble glGetDouble (GLenum pname) |
|
|
2348 | CODE: |
|
|
2349 | glGetDoublev (pname, &RETVAL); |
|
|
2350 | OUTPUT: |
|
|
2351 | RETVAL |
|
|
2352 | |
2285 | int glGetError () |
2353 | int glGetError () |
2286 | |
2354 | |
2287 | void glFinish () |
2355 | void glFinish () |
2288 | |
2356 | |
2289 | void glClear (int mask) |
2357 | void glClear (int mask) |
… | |
… | |
2411 | |
2479 | |
2412 | void glCopyTexImage2D (int target, int level, int internalformat, int x, int y, int width, int height, int border) |
2480 | void glCopyTexImage2D (int target, int level, int internalformat, int x, int y, int width, int height, int border) |
2413 | |
2481 | |
2414 | void glDrawPixels (int width, int height, int format, int type, char *pixels) |
2482 | void glDrawPixels (int width, int height, int format, int type, char *pixels) |
2415 | |
2483 | |
|
|
2484 | void glPixelZoom (float x, float y) |
|
|
2485 | |
2416 | void glCopyPixels (int x, int y, int width, int height, int type = GL_COLOR) |
2486 | void glCopyPixels (int x, int y, int width, int height, int type = GL_COLOR) |
2417 | |
2487 | |
2418 | int glGenTexture () |
2488 | int glGenTexture () |
2419 | CODE: |
2489 | CODE: |
2420 | RETVAL = gen_texture (); |
2490 | RETVAL = gen_texture (); |