You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.5 KiB

#ifndef PLATFORM_H
#define PLATFORM_H
#include <global.h>
13 years ago
class Platform
{
13 years ago
public:
static void init(const char *appName);
static void terminate();
/// Poll platform input/window events
13 years ago
static void poll();
/// Get current time in milliseconds since init
13 years ago
static int getTicks();
/// Sleep in current thread
13 years ago
static void sleep(ulong miliseconds);
13 years ago
static bool createWindow(int x, int y, int width, int height, int minWidth, int minHeight, bool maximized);
static void destroyWindow();
static void showWindow();
static void setWindowTitle(const char *title);
static bool isWindowFocused();
static bool isWindowVisible();
static int getWindowX();
static int getWindowY();
static int getWindowWidth();
static int getWindowHeight();
static bool isWindowMaximized();
13 years ago
static int getDisplayHeight();
static int getDisplayWidth();
/// Get GL extension function address
13 years ago
static void *getExtensionProcAddress(const char *ext);
/// Check if GL extension is supported
13 years ago
static bool isExtensionSupported(const char *ext);
13 years ago
static const char *getClipboardText();
static void setClipboardText(const char *text);
13 years ago
static void hideMouseCursor();
static void showMouseCursor();
/// Enable/disable vertical synchronization
13 years ago
static void setVsync(bool enable = true);
/// Swap GL buffers
13 years ago
static void swapBuffers();
/// Get the app user directory, the place to save files configurations files
13 years ago
static std::string getAppUserDir();
};
#endif // PLATFORM_H