3 Quick and Dirty Game Development Framework (QDGDF)
5 Copyright (C) 2001/2011 Angel Ortega <angel@triptico.com>
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 qdgdf_i [X size] [Y size] [scale] [full screen]
29 #include "qdgdf_video.h"
30 #include "qdgdf_audio.h"
40 info
[y
++] = strdup(qdgdfv_sprintf("QDGDF %s", _qdgdfv_version
));
41 info
[y
++] = strdup(qdgdfv_sprintf("%d x %d (scale %d)",
42 _qdgdfv_screen_x_size
,
43 _qdgdfv_screen_y_size
,
45 info
[y
++] = strdup(qdgdfv_sprintf("full screen: %d",
46 _qdgdfv_full_screen
));
47 info
[y
++] = strdup(qdgdfv_sprintf("window position: %d x %d",
50 info
[y
++] = strdup(qdgdfv_sprintf("pixel size: %d", _qdgdfv_pixel_size
));
51 info
[y
++] = strdup(qdgdfv_sprintf("home dir: %s", qdgdfv_home_dir()));
52 info
[y
++] = strdup(qdgdfv_sprintf("app dir: %s", qdgdfv_app_dir()));
53 info
[y
++] = strdup(qdgdfv_sprintf("sound: %d (%d bit)",
55 _qdgdfa_16_bit
? 16 : 8));
58 info
[y
++] = "OpenGL support enabled";
60 info
[y
++] = "OpenGL support disabled";
67 int c
= qdgdfv_seek_color(255, 255, 255);
70 qdgdfv_clear_virtual_screen();
72 for (y
= 0; info
[y
] != NULL
; y
++)
73 qdgdfv_font_print(1, y
* _qdgdfv_font_height
, info
[y
], c
);
75 qdgdfv_font_print(1, y
* _qdgdfv_font_height
,
76 qdgdfv_sprintf("%d %c", _qdgdfv_key_alnum
, _qdgdfv_alnum
),
79 qdgdfv_font_print(-1, -1, "Press ESCAPE", c
);
81 qdgdfv_dump_virtual_screen();
85 void show_opengl(void)
88 static double theta
= 0.0;
90 glClearColor(0.0f
, 0.0f
, 0.0f
, 0.0f
);
91 glClear(GL_COLOR_BUFFER_BIT
);
94 glRotatef(theta
, 0.0f
, 0.0f
, 1.0f
);
95 glBegin(GL_TRIANGLES
);
96 glColor3f(1.0f
, 0.0f
, 0.0f
);
97 glVertex2f(0.0f
, 1.0f
);
98 glColor3f(0.0f
, 1.0f
, 0.0f
);
99 glVertex2f(0.87f
, -0.5f
);
100 glColor3f(0.0f
, 0.0f
, 1.0f
);
101 glVertex2f(-0.87f
, -0.5f
);
108 qdgdfv_dump_virtual_screen();
113 int main(int argc
, char *argv
[])
117 strcpy(_qdgdfv_window_title
, "QDGDF Information");
120 _qdgdfv_screen_x_size
= atoi(argv
[n
++]);
122 _qdgdfv_screen_y_size
= atoi(argv
[n
++]);
124 _qdgdfv_scale
= atoi(argv
[n
++]);
126 _qdgdfv_full_screen
= atoi(argv
[n
++]);
128 strcpy(_qdgdfv_logger_file
, "qdgdf.log");
129 _qdgdfv_use_logger
= 1;
139 } while (!_qdgdfv_key_escape
);
141 while (_qdgdfv_key_escape
)
144 if (qdgdfv_opengl(1)) {
148 } while (!_qdgdfv_key_escape
);