Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
93 lines (80 loc) · 2.3 KB

common.h

File metadata and controls

93 lines (80 loc) · 2.3 KB
 
Apr 8, 2011
Apr 8, 2011
1
2
3
4
5
6
7
8
9
10
11
/*
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely.
*/
12
13
14
/* A simple test program framework */
Dec 14, 2009
Dec 14, 2009
15
#define SDL_NO_COMPAT
16
17
#include "SDL.h"
Mar 27, 2011
Mar 27, 2011
18
19
20
21
#ifdef __NDS__
#define DEFAULT_WINDOW_WIDTH 256
#define DEFAULT_WINDOW_HEIGHT (2*192)
#else
Jun 11, 2009
Jun 11, 2009
22
23
#define DEFAULT_WINDOW_WIDTH 640
#define DEFAULT_WINDOW_HEIGHT 480
Mar 27, 2011
Mar 27, 2011
24
#endif
Jun 11, 2009
Jun 11, 2009
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#define VERBOSE_VIDEO 0x00000001
#define VERBOSE_MODES 0x00000002
#define VERBOSE_RENDER 0x00000004
#define VERBOSE_EVENT 0x00000008
#define VERBOSE_AUDIO 0x00000010
typedef struct
{
/* SDL init flags */
char **argv;
Uint32 flags;
Uint32 verbose;
/* Video info */
const char *videodriver;
int display;
const char *window_title;
Jul 15, 2010
Jul 15, 2010
43
const char *window_icon;
44
45
46
47
48
49
50
51
Uint32 window_flags;
int window_x;
int window_y;
int window_w;
int window_h;
int depth;
int refresh_rate;
int num_windows;
Jan 21, 2010
Jan 21, 2010
52
SDL_Window **windows;
53
54
55
56
/* Renderer info */
const char *renderdriver;
Uint32 render_flags;
Jul 24, 2006
Jul 24, 2006
57
SDL_bool skip_renderer;
Feb 2, 2011
Feb 2, 2011
58
SDL_Renderer **renderers;
59
60
61
62
/* Audio info */
const char *audiodriver;
SDL_AudioSpec audiospec;
Oct 21, 2009
Oct 21, 2009
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* GL settings */
int gl_red_size;
int gl_green_size;
int gl_blue_size;
int gl_alpha_size;
int gl_buffer_size;
int gl_depth_size;
int gl_stencil_size;
int gl_double_buffer;
int gl_accum_red_size;
int gl_accum_green_size;
int gl_accum_blue_size;
int gl_accum_alpha_size;
int gl_stereo;
int gl_multisamplebuffers;
int gl_multisamplesamples;
int gl_retained_backing;
int gl_accelerated;
int gl_major_version;
int gl_minor_version;
84
85
86
87
88
89
90
91
} CommonState;
extern CommonState *CommonCreateState(char **argv, Uint32 flags);
extern int CommonArg(CommonState * state, int index);
extern const char *CommonUsage(CommonState * state);
extern SDL_bool CommonInit(CommonState * state);
extern void CommonEvent(CommonState * state, SDL_Event * event, int *done);
extern void CommonQuit(CommonState * state);
Dec 2, 2009
Dec 2, 2009
92
93
/* vi: set ts=4 sw=4 expandtab: */