Polycode::Core Class Reference

The main core of the framework. More...

Inherits Polycode::EventDispatcher.

Inherited by Polycode::AGLCore, Polycode::CocoaCore, Polycode::IPhoneCore, Polycode::SDLCore, and Polycode::Win32Core.

List of all members.

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.
CoreServicesgetServices ()
 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.
CoreInputgetInput ()
 Returns the input class.
Number getXRes ()
 Returns current horizontal resolution.
Number getYRes ()
 Returns current vertical resolution.
virtual std::vector< RectanglegetVideoModes ()=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< StringopenFilePicker (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.

Detailed Description

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!!


Constructor & Destructor Documentation

Polycode::Core::Core ( int  xRes,
int  yRes,
bool  fullScreen,
bool  vSync,
int  aaLevel,
int  anisotropyLevel,
int  frameRate,
int  monitorIndex 
)

Constructor.

Parameters:
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.

Member Function Documentation

virtual void Polycode::Core::copyDiskItem ( const String itemPath,
const String destItemPath 
) [pure virtual]

Copies a disk item from one path to another.

Parameters:
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.

Parameters:
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.

Parameters:
folderPath Path to create the folder in.
virtual CoreMutex* Polycode::Core::createMutex (  )  [pure virtual]

Creates a mutex.

Returns:
Newly created mutex.
virtual void Polycode::Core::createThread ( Threaded target  )  [pure virtual]

Launches a Threaded class into its own thread.

See the documentation for Threaded for information on how to crated threaded classes.

Parameters:
target Target threaded class.
See also:
Threaded
void Polycode::Core::enableMouse ( bool  newval  )  [virtual]

Show or hide cursor.

Parameters:
newval True to show mouse, false to hide it.
int Polycode::Core::getAALevel (  )  [inline]

Returns the current anti-aliasing level.

Returns:
Current anti-aliasing level.
virtual String Polycode::Core::getClipboardString (  )  [pure virtual]

Returns the system clipboard as a string.

Returns:
String from clipboard.
Number Polycode::Core::getElapsed (  ) 

Returns the time elapsed since last frame.

Returns:
Time elapsed since last frame in floating point microseconds.
Number Polycode::Core::getFPS (  ) 

Returns the current average frames per second.

Returns:
Current average frames per second.
CoreInput * Polycode::Core::getInput (  ) 

Returns the input class.

See CoreInput for details in input.

Returns:
Input class.
See also:
CoreInput
CoreServices * Polycode::Core::getServices (  ) 

Returns the core services.

See CoreServices for a detailed explanation of services.

Returns:
Core services.
See also:
CoreServices
virtual unsigned int Polycode::Core::getTicks (  )  [pure virtual]

Returns the total ticks elapsed since launch.

Returns:
Time elapsed since launch in milliseconds
Number Polycode::Core::getTicksFloat (  ) 

Returns the total ticks elapsed since launch.

Returns:
Time elapsed since launch in floating point microseconds.
virtual std::vector<Rectangle> Polycode::Core::getVideoModes (  )  [pure virtual]

Returns the available system video modes.

Returns:
An STL vector of video modes.
Number Polycode::Core::getXRes (  ) 

Returns current horizontal resolution.

Returns:
Current horizontal resolution.
Number Polycode::Core::getYRes (  ) 

Returns current vertical resolution.

Returns:
Current vertical resolution.
bool Polycode::Core::isFullscreen (  )  [inline]

Checks if core is in fullscreen mode.

Returns:
True if in full screen, false if otherwise.
virtual void Polycode::Core::lockMutex ( CoreMutex *  mutex  )  [pure virtual]

Locks a mutex.

Parameters:
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.

Parameters:
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.

Parameters:
extensions An STL vector containing the allowed file extensions that can be selected.
allowMultiple If set to true, the picker can select multiple files.
Returns:
An STL vector of the selected file paths.
virtual String Polycode::Core::openFolderPicker (  )  [pure virtual]

Opens a system folder picker and suspends operation.

Returns:
The selected path returned from the picker.
virtual void Polycode::Core::openURL ( String  url  )  [inline, virtual]

Launches the default browser and directs it to specified URL.

Parameters:
url URL to launch.
virtual void Polycode::Core::removeDiskItem ( const String itemPath  )  [pure virtual]

Removes a disk item.

Parameters:
itemPath Path to the item to remove.
virtual void Polycode::Core::resizeTo ( int  xRes,
int  yRes 
) [pure virtual]

Resizes the renderer.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
x New cursor x position
y New cursor y position
Generated on Sat Aug 11 18:04:11 2012 for Polycode by  doxygen 1.6.3