1 /* oglconsole -- gpl license here */
2 /* Added macro for con_printf() -- lon */
3 #define OGLCONSOLE_USE_SDL
12 /* Opaque to you you lowly user */
13 typedef struct _OGLCONSOLE_Console
*OGLCONSOLE_Console
;
15 /* Initialize/uninitialize OGLConsole */
16 OGLCONSOLE_Console
OGLCONSOLE_Create(void);
17 void OGLCONSOLE_InitText(void *console
, int res_x
, int res_y
);
18 void OGLCONSOLE_Destroy(OGLCONSOLE_Console console
);
19 void OGLCONSOLE_Quit(void);
21 int command_split(char *cmd
, int *argc
, char **argv
, int max
);
23 /* Set console which has PROGRAMMER focus (not application focus) */
25 /* This function renders the console */
26 void OGLCONSOLE_Draw(void);
27 void OGLCONSOLE_Render(OGLCONSOLE_Console console
);
29 /* Print to the console */
30 void OGLCONSOLE_Print(char *s
, ...);
31 void OGLCONSOLE_Output(OGLCONSOLE_Console console
, const char *s
, ...);
33 #define con_printf(fmt, args...) \
35 printf(fmt, ##args); \
36 OGLCONSOLE_Print(fmt, ##args); \
39 /* Register a callback with the console */
40 void OGLCONSOLE_EnterKey(void(*cbfun
)(OGLCONSOLE_Console console
,
41 int argc
, char **argv
));
43 /* This function tries to handle the incoming SDL event. In the future there may
44 * be non-SDL analogs for input systems such as GLUT. Returns true if the event
45 * was handled by the console. If console is hidden, no events are handled. */
46 #if defined(OGLCONSOLE_USE_SDL)
48 int OGLCONSOLE_SDLEvent(SDL_Event
* e
);
51 /* Sets the current console for receiving user input */
52 void OGLCONSOLE_FocusConsole(OGLCONSOLE_Console console
);
54 /* Sets the current console for making options changes to */
55 void OGLCONSOLE_EditConsole(OGLCONSOLE_Console console
);
57 /* Sets the dimensions of the console in lines and columns of characters. */
58 void OGLCONSOLE_SetDimensions(int width
, int height
);
60 /* Show or hide the console. */
61 void OGLCONSOLE_SetVisibility(int visible
);