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 /* Set console which has PROGRAMMER focus (not application focus) */
23 /* This function renders the console */
24 void OGLCONSOLE_Draw(void);
25 void OGLCONSOLE_Render(OGLCONSOLE_Console console
);
27 /* Print to the console */
28 void OGLCONSOLE_Print(char *s
, ...);
29 void OGLCONSOLE_Output(OGLCONSOLE_Console console
, const char *s
, ...);
31 #define con_printf(fmt, args...) \
33 printf(fmt, ##args); \
34 OGLCONSOLE_Print(fmt, ##args); \
37 /* Register a callback with the console */
38 void OGLCONSOLE_EnterKey(void(*cbfun
)(OGLCONSOLE_Console console
, char *cmd
));
40 /* This function tries to handle the incoming SDL event. In the future there may
41 * be non-SDL analogs for input systems such as GLUT. Returns true if the event
42 * was handled by the console. If console is hidden, no events are handled. */
43 #if defined(OGLCONSOLE_USE_SDL)
45 int OGLCONSOLE_SDLEvent(SDL_Event
* e
);
48 /* Sets the current console for receiving user input */
49 void OGLCONSOLE_FocusConsole(OGLCONSOLE_Console console
);
51 /* Sets the current console for making options changes to */
52 void OGLCONSOLE_EditConsole(OGLCONSOLE_Console console
);
54 /* Sets the dimensions of the console in lines and columns of characters. */
55 void OGLCONSOLE_SetDimensions(int width
, int height
);
57 /* Show or hide the console. */
58 void OGLCONSOLE_SetVisibility(int visible
);