#include <engine.h>
Public Methods | |
KrEngine (SDL_Surface *screen) | |
Creates an engine that renders to the entire screen. More... | |
KrEngine (SDL_Surface *screen, const KrRect &bounds, const KrRGBA *extraFill) | |
Sets up an engine that renders to a rectangle on the screen, instead of the entire screen. More... | |
KrEngine (SDL_Surface *screen, int nWindows, const KrRect *bounds, const KrRGBA *extraFill) | |
Sets up an engine that renders to multiple "windows" on the same surface. More... | |
KrImageTree * | Tree () |
Fetch the ImageTree. More... | |
KrResourceVault * | Vault () |
Fetch a vault. More... | |
int | NumWindows () |
How many windows does this engine have? | |
int | GetWindowFromPoint (int x, int y) |
Given a point (in screen coordinates), what window is it in? -1 if none. | |
void | Draw (bool updateRect=true, GlDynArray< KrRect > *rectangles=0) |
Once everything is ready to go, sprites and such are updated, call this method to put it all on the screen. More... | |
const KrRect & | ScreenBounds (int window=0) |
Return the bounds we are drawing to. More... | |
const KrRect & | FullScreenBounds () |
Retrun the bounds of the entire screen surface. | |
void | InvalidateRectangle (const KrRect &rect, int window=0) |
Pass in a rectangle that should be invalidated. More... | |
SDL_Surface * | Surface () |
Query the surface pointer used by this engine. | |
void | InvalidateScreen () |
Invalidate everything and mark for repaint. Follow with call to Draw(). | |
void | QueryRenderDesc (std::string *desc) |
Get a text description of the current rendering mode. | |
void | StartSplash (U32 msec) |
StartSplash displays the Kyra Splash screen. More... | |
bool | UpdateSplash (U32 msec) |
Updates the splash animation. More... | |
void | EndSplash () |
Removes the splash screen and clears the data and resources it is using. | |
void | FillBackground (const KrRGBA *fillColor) |
Will fill the background with the specified color before drawing Images. More... | |
void | FillBackgroundWindow (int window, const KrRGBA *fillColor) |
Set the fill of a particular backrgound window. | |
Static Public Methods | |
void | Version (int *major, int *minor, int *patch) |
Get the major, minor, and patch version of the engine. | |
void | SetMaxOglTextureSize (int size) |
Set the maximize size of an OpenGL texture. More... | |
int | MaxOglTextureSize () |
Query the current max texture size. (0 is no Kyra imposed limit.). |
Instantiate an Engine to start using the sprite engine.
|
Creates an engine that renders to the entire screen.
|
|
Sets up an engine that renders to a rectangle on the screen, instead of the entire screen.
|
|
Sets up an engine that renders to multiple "windows" on the same surface. No window may overlap another. Each window is oriented with 0,0 as its upper left hand coordinate.
|
|
Once everything is ready to go, sprites and such are updated, call this method to put it all on the screen.
|
|
Will fill the background with the specified color before drawing Images. If the Images let no background screen show through, NULL should be passed in to turn this feature off for a performance improvement. |
|
Pass in a rectangle that should be invalidated. Only used for unusual circumstances - primarily to clear a user-draw. |
|
Return the bounds we are drawing to. (Not necessarily the entire screen.) Set by the constructor. |
|
Set the maximize size of an OpenGL texture. This is the max size of either the x or y axis, so this limits memory usage to effectively: max texture memory used = size * size * 4 Useful to contain memory usage of large sprites. Quality, of course, will suffer if the size is constrained. Set to 0 (the default) to limit the largest size to that allowed by the driver. Note: This is static. The effect is global. |
|
StartSplash displays the Kyra Splash screen. Pass in the current time in msec (can be queried from SDL_GetTicks) that is used by future calls to control the timeline. FillBackground() needs to be on (the default) for the splash screen, unless the client provides a background screen. |
|
Fetch the ImageTree. Even though it lives in the Engine, the Tree will be managed by the user. The KrImageTree returned is owned by the engine. It should not be deleted by the client code. |
|
Updates the splash animation. The Splash is one second long, but can be displayed for any amount of time. |
|
Fetch a vault. Every engine needs a vault and there is nothing special about this one, except that it is managed with the engine and will be created and deleted at the correct time. The KrResourceVault is owned by the engine. It should not be deleted by the client code. |