The main core of the framework. More...
Inherits Polycode::EventDispatcher.
Inherited by Polycode::AGLCore, Polycode::CocoaCore, Polycode::IPhoneCore, Polycode::SDLCore, and Polycode::Win32Core.
Public Member Functions | |
Core (int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, int frameRate, int monitorIndex) | |
Constructor. | |
virtual void | enableMouse (bool newval) |
Show or hide cursor. | |
virtual void | setCursor (int cursorType)=0 |
Sets the cursor the application is using. | |
virtual void | warpCursor (int x, int y) |
Warps the cursor to a specified point in the window. | |
virtual void | createThread (Threaded *target)=0 |
Launches a Threaded class into its own thread. | |
virtual void | lockMutex (CoreMutex *mutex)=0 |
Locks a mutex. | |
virtual void | unlockMutex (CoreMutex *mutex)=0 |
Unlocks a mutex. | |
virtual CoreMutex * | createMutex ()=0 |
Creates a mutex. | |
virtual void | copyStringToClipboard (const String &str)=0 |
Copies the specified string to system clipboard. | |
virtual String | getClipboardString ()=0 |
Returns the system clipboard as a string. | |
CoreServices * | getServices () |
Returns the core services. | |
Number | getFPS () |
Returns the current average frames per second. | |
void | Shutdown () |
Shuts down the core and quits the application. | |
bool | isFullscreen () |
Checks if core is in fullscreen mode. | |
int | getAALevel () |
Returns the current anti-aliasing level. | |
CoreInput * | getInput () |
Returns the input class. | |
Number | getXRes () |
Returns current horizontal resolution. | |
Number | getYRes () |
Returns current vertical resolution. | |
virtual std::vector< Rectangle > | getVideoModes ()=0 |
Returns the available system video modes. | |
virtual void | createFolder (const String &folderPath)=0 |
Creates a folder on disk with the specified path. | |
virtual void | copyDiskItem (const String &itemPath, const String &destItemPath)=0 |
Copies a disk item from one path to another. | |
virtual void | moveDiskItem (const String &itemPath, const String &destItemPath)=0 |
Moves a disk item from one path to another. | |
virtual void | removeDiskItem (const String &itemPath)=0 |
Removes a disk item. | |
virtual String | openFolderPicker ()=0 |
Opens a system folder picker and suspends operation. | |
virtual std::vector< String > | openFilePicker (std::vector< CoreFileExtension > extensions, bool allowMultiple)=0 |
Opens a system file picker for the specified extensions. | |
virtual void | setVideoMode (int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel)=0 |
Sets a new video mode. | |
virtual void | resizeTo (int xRes, int yRes)=0 |
Resizes the renderer. | |
virtual void | openURL (String url) |
Launches the default browser and directs it to specified URL. | |
Number | getElapsed () |
Returns the time elapsed since last frame. | |
virtual unsigned int | getTicks ()=0 |
Returns the total ticks elapsed since launch. | |
Number | getTicksFloat () |
Returns the total ticks elapsed since launch. | |
String | getDefaultWorkingDirectory () |
Returns the default working path of the application. | |
String | getUserHomeDirectory () |
Returns the default working path of the application. |
The main core of the framework.
The core deals with system-level functions, such as window initialization and OS interaction. Each platform has its own implementation of this base class. NOTE: SOME OF THE FUNCTIONALITY IN THE CORE IS NOT FULLY IMPLEMENTED!!
Polycode::Core::Core | ( | int | xRes, | |
int | yRes, | |||
bool | fullScreen, | |||
bool | vSync, | |||
int | aaLevel, | |||
int | anisotropyLevel, | |||
int | frameRate, | |||
int | monitorIndex | |||
) |
Constructor.
xRes | Inital horizontal resolution of the renderer. | |
yRes | Inital vertical resolution of the renderer. | |
fullScreen | True to launch in fullscreen, false to launch in window. | |
aaLevel | Level of anti-aliasing. Possible values are 2,4 and 6. | |
frameRate | Frame rate that the core will update and render at. | |
monitorIndex | If fullScreen is true, the monitor index to fullscreen to. Pass -1 to use primary monitor. |
virtual void Polycode::Core::copyDiskItem | ( | const String & | itemPath, | |
const String & | destItemPath | |||
) | [pure virtual] |
Copies a disk item from one path to another.
itemPath | Path to the item to copy. | |
destItemPath | Destination path to copy to. |
virtual void Polycode::Core::copyStringToClipboard | ( | const String & | str | ) | [pure virtual] |
Copies the specified string to system clipboard.
str | String to copy to clipboard. |
virtual void Polycode::Core::createFolder | ( | const String & | folderPath | ) | [pure virtual] |
Creates a folder on disk with the specified path.
folderPath | Path to create the folder in. |
virtual CoreMutex* Polycode::Core::createMutex | ( | ) | [pure virtual] |
Creates a mutex.
virtual void Polycode::Core::createThread | ( | Threaded * | target | ) | [pure virtual] |
void Polycode::Core::enableMouse | ( | bool | newval | ) | [virtual] |
Show or hide cursor.
newval | True to show mouse, false to hide it. |
int Polycode::Core::getAALevel | ( | ) | [inline] |
Returns the current anti-aliasing level.
virtual String Polycode::Core::getClipboardString | ( | ) | [pure virtual] |
Returns the system clipboard as a string.
Number Polycode::Core::getElapsed | ( | ) |
Returns the time elapsed since last frame.
Number Polycode::Core::getFPS | ( | ) |
Returns the current average frames per second.
CoreInput * Polycode::Core::getInput | ( | ) |
CoreServices * Polycode::Core::getServices | ( | ) |
Returns the core services.
See CoreServices for a detailed explanation of services.
virtual unsigned int Polycode::Core::getTicks | ( | ) | [pure virtual] |
Returns the total ticks elapsed since launch.
Number Polycode::Core::getTicksFloat | ( | ) |
Returns the total ticks elapsed since launch.
virtual std::vector<Rectangle> Polycode::Core::getVideoModes | ( | ) | [pure virtual] |
Returns the available system video modes.
Number Polycode::Core::getXRes | ( | ) |
Returns current horizontal resolution.
Number Polycode::Core::getYRes | ( | ) |
Returns current vertical resolution.
bool Polycode::Core::isFullscreen | ( | ) | [inline] |
Checks if core is in fullscreen mode.
virtual void Polycode::Core::lockMutex | ( | CoreMutex * | mutex | ) | [pure virtual] |
Locks a mutex.
mutex | Mutex to lock. |
virtual void Polycode::Core::moveDiskItem | ( | const String & | itemPath, | |
const String & | destItemPath | |||
) | [pure virtual] |
Moves a disk item from one path to another.
itemPath | Path to the item to move. | |
destItemPath | Destination path to move to. |
virtual std::vector<String> Polycode::Core::openFilePicker | ( | std::vector< CoreFileExtension > | extensions, | |
bool | allowMultiple | |||
) | [pure virtual] |
Opens a system file picker for the specified extensions.
extensions | An STL vector containing the allowed file extensions that can be selected. | |
allowMultiple | If set to true, the picker can select multiple files. |
virtual String Polycode::Core::openFolderPicker | ( | ) | [pure virtual] |
Opens a system folder picker and suspends operation.
virtual void Polycode::Core::openURL | ( | String | url | ) | [inline, virtual] |
Launches the default browser and directs it to specified URL.
url | URL to launch. |
virtual void Polycode::Core::removeDiskItem | ( | const String & | itemPath | ) | [pure virtual] |
Removes a disk item.
itemPath | Path to the item to remove. |
virtual void Polycode::Core::resizeTo | ( | int | xRes, | |
int | yRes | |||
) | [pure virtual] |
Resizes the renderer.
xRes | New horizontal resolution of the renderer. | |
yRes | New vertical resolution of the renderer. |
virtual void Polycode::Core::setCursor | ( | int | cursorType | ) | [pure virtual] |
Sets the cursor the application is using.
cursorType | Type of cursor to use. Possible values are CURSOR_ARROW, CURSOR_TEXT, CURSOR_POINTER, CURSOR_CROSSHAIR, CURSOR_RESIZE_LEFT_RIGHT, CURSOR_RESIZE_UP_DOWN |
virtual void Polycode::Core::setVideoMode | ( | int | xRes, | |
int | yRes, | |||
bool | fullScreen, | |||
bool | vSync, | |||
int | aaLevel, | |||
int | anisotropyLevel | |||
) | [pure virtual] |
Sets a new video mode.
xRes | New horizontal resolution of the renderer. | |
yRes | New vertical resolution of the renderer. | |
fullScreen | True to launch in fullscreen, false to launch in window. | |
aaLevel | Level of anti-aliasing. Possible values are 2,4 and 6. |
virtual void Polycode::Core::unlockMutex | ( | CoreMutex * | mutex | ) | [pure virtual] |
Unlocks a mutex.
mutex | Mutex to lock. |
virtual void Polycode::Core::warpCursor | ( | int | x, | |
int | y | |||
) | [inline, virtual] |
Warps the cursor to a specified point in the window.
x | New cursor x position | |
y | New cursor y position |