1 | #ifdef _WIN32 |
1 | #ifdef _WIN32 |
|
|
2 | # define WIN32_LEAN_AND_MEAN |
2 | # define _WIN32_WINNT 0x0500 // needed to get win2000 api calls |
3 | # define _WIN32_WINNT 0x0500 // needed to get win2000 api calls |
3 | # include <malloc.h> |
4 | # include <malloc.h> |
4 | # include <windows.h> |
5 | # include <windows.h> |
5 | # pragma warning(disable:4244) |
6 | # pragma warning(disable:4244) |
6 | #endif |
7 | #endif |
7 | |
8 | |
8 | #include "EXTERN.h" |
9 | #include "EXTERN.h" |
9 | #include "perl.h" |
10 | #include "perl.h" |
10 | #include "XSUB.h" |
11 | #include "XSUB.h" |
|
|
12 | |
|
|
13 | #ifdef _WIN32 |
|
|
14 | # undef pipe |
|
|
15 | #endif |
11 | |
16 | |
12 | #include <math.h> |
17 | #include <math.h> |
13 | #include <string.h> |
18 | #include <string.h> |
14 | #include <stdio.h> |
19 | #include <stdio.h> |
15 | #include <stdlib.h> |
20 | #include <stdlib.h> |
… | |
… | |
39 | typedef unsigned int uint32_t; |
44 | typedef unsigned int uint32_t; |
40 | typedef signed char int8_t; |
45 | typedef signed char int8_t; |
41 | typedef signed short int16_t; |
46 | typedef signed short int16_t; |
42 | typedef signed int int32_t; |
47 | typedef signed int int32_t; |
43 | #endif |
48 | #endif |
44 | |
|
|
45 | #include "glext.h" |
|
|
46 | |
49 | |
47 | #define OBJ_STR "\xef\xbf\xbc" /* U+FFFC, objetc replacement character */ |
50 | #define OBJ_STR "\xef\xbf\xbc" /* U+FFFC, objetc replacement character */ |
48 | |
51 | |
49 | #define FOW_DARKNESS 32 |
52 | #define FOW_DARKNESS 32 |
50 | |
53 | |
… | |
… | |
509 | SDL_GL_SetAttribute (SDL_GL_ACCUM_GREEN_SIZE, 0); |
512 | SDL_GL_SetAttribute (SDL_GL_ACCUM_GREEN_SIZE, 0); |
510 | SDL_GL_SetAttribute (SDL_GL_ACCUM_BLUE_SIZE, 0); |
513 | SDL_GL_SetAttribute (SDL_GL_ACCUM_BLUE_SIZE, 0); |
511 | SDL_GL_SetAttribute (SDL_GL_ACCUM_ALPHA_SIZE, 0); |
514 | SDL_GL_SetAttribute (SDL_GL_ACCUM_ALPHA_SIZE, 0); |
512 | |
515 | |
513 | SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); |
516 | SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); |
|
|
517 | SDL_GL_SetAttribute (SDL_GL_ACCELERATED_VISUAL, 1); |
|
|
518 | SDL_GL_SetAttribute (SDL_GL_SWAP_CONTROL, 1); |
514 | |
519 | |
515 | SDL_EnableUNICODE (1); |
520 | SDL_EnableUNICODE (1); |
516 | SDL_EnableKeyRepeat (SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); |
521 | SDL_EnableKeyRepeat (SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); |
517 | |
522 | |
518 | m = SDL_ListModes (0, SDL_FULLSCREEN | SDL_OPENGL); |
523 | m = SDL_ListModes (0, SDL_FULLSCREEN | SDL_OPENGL); |
… | |
… | |
1914 | r *= a; |
1919 | r *= a; |
1915 | g *= a; |
1920 | g *= a; |
1916 | b *= a; |
1921 | b *= a; |
1917 | } |
1922 | } |
1918 | // microsoft visual "c" rounds instead of truncating... |
1923 | // microsoft visual "c" rounds instead of truncating... |
1919 | glColor4ub (MIN ((int)(r * 256.f), 255), |
1924 | glColor4f (r, g, b, a); |
1920 | MIN ((int)(g * 256.f), 255), |
|
|
1921 | MIN ((int)(b * 256.f), 255), |
|
|
1922 | MIN ((int)(a * 256.f), 255)); |
|
|
1923 | |
1925 | |
1924 | void glInterleavedArrays (int format, int stride, char *data) |
1926 | void glInterleavedArrays (int format, int stride, char *data) |
1925 | |
1927 | |
1926 | void glDrawElements (int mode, int count, int type, char *indices) |
1928 | void glDrawElements (int mode, int count, int type, char *indices) |
1927 | |
1929 | |