Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

CONSOLE.H

Go to the documentation of this file.
00001 /****************************************************************************************/
00002 /*  Console.h                                                                           */
00003 /*                                                                                      */
00004 /*  Author: John Pollard                                                                */
00005 /*  Description:                                                                        */
00006 /*                                                                                      */
00007 /*  Copyright (c) 1997, 1999, Eclipse Entertainment; All rights reserved.               */
00008 /*                                                                                      */
00009 /*  See the accompanying file LICENSE.TXT for terms on the use of this library.         */
00010 /*  This library is distributed in the hope that it will be useful but WITHOUT          */
00011 /*  ANY WARRANTY OF ANY KIND and without any implied warranty of MERCHANTABILITY        */
00012 /*  or FITNESS FOR ANY PURPOSE.  Refer to LICENSE.TXT for more details.                 */
00013 /*                                                                                      */
00014 /****************************************************************************************/
00015 #ifndef __CONSOLE_H__
00016 #define __CONSOLE_H__
00017 
00018 #include "Genesis.h"
00019 
00020 #define SMALL_CONSOLE_CUTOFF_WIDTH (640)
00021 
00022 #include "VidMode.h"
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00028 //================================================================================
00029 //================================================================================
00030 #define TEXT_BUFFER_SIZE                        4096                    // 4k text buffer should do it...
00031 #define TOKEN_BUFFER_SIZE                       1024    
00032 
00033 #define MAX_HEADER_TEXT_SIZE            128
00034 #define MAX_HEADER_STRINGS                      4
00035 #define HEADER_STAY_TIME                        5.0f
00036 
00037 typedef struct
00038 {
00039         geBoolean               Active;                                                 // GE_TRUE is console is down..
00040         geBoolean               Fast;                                                   // Fast movement
00041 
00042         geEngine                *Engine;
00043 
00044         // Screen info
00045         VidMode                 VidMode;
00046 
00047         // Info about how to display console
00048         float                   DrawYPos;
00049 
00050         // Text buffer info
00051         char                    TokenBuffer[TOKEN_BUFFER_SIZE];
00052         char                    TextBuffer[TEXT_BUFFER_SIZE];
00053         int32                   PrintPos;                                               // Current print pos
00054         int32                   CursorPos;                                              // Where text is current being inserted
00055         int32                   CursorX;                                                // Where X and y is on the screen
00056         int32                   CursorY;
00057 
00058         int32                   BackScroll;
00059         int32                   Scroll;
00060 
00061         int32                   StopX;
00062         int32                   StopY;
00063 
00064         geBitmap                *BGBitmap;
00065 
00066         // Font
00067         int32                   FontWidth;
00068         int32                   FontHeight;
00069         int32                   FontLUT1[128];
00070         geBitmap                *FontBitmap;
00071 
00072         char                    HeaderText[MAX_HEADER_STRINGS][MAX_HEADER_TEXT_SIZE];
00073         float                   HeaderTime[MAX_HEADER_STRINGS];
00074         int32                   CurrentHeader;
00075 
00076         // User data
00077         void                    *UserData;
00078 
00079 } Console_Console;
00080 
00081 //================================================================================
00082 //================================================================================
00083 Console_Console *Console_Create(geEngine *Engine, VidMode VidMode);
00084 void                    Console_Destroy(Console_Console *Console);
00085 void                    Console_FreeResources(Console_Console *Console);
00086 geBoolean               Console_Printf(Console_Console *Console, const char *Str, ...);
00087 geBoolean               Console_HeaderPrintf(Console_Console *Console, const char *Str, ...);
00088 geBoolean               Console_XYPrintf(Console_Console *Console, int32 x, int32 y, uint32 Flags, const char *Str, ...);
00089 geBoolean               Console_ToggleActive(Console_Console *Console);
00090 void                    Console_GetActive(Console_Console *Console, geBoolean *Active, geBoolean *Fast);
00091 void                    Console_SetActive(Console_Console *Console, geBoolean Active, geBoolean Fast);
00092 geBoolean               Console_KeyDown(Console_Console *Console, int32 Key, geBoolean Cmd);
00093 geBoolean               Console_Frame(Console_Console *Console, float Time);
00094 
00095 #endif

Generated on Tue Sep 30 12:35:26 2003 for GTestAndEngine by doxygen 1.3.2