summaryrefslogtreecommitdiff
path: root/platform/windows
diff options
context:
space:
mode:
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/context_gl_win.cpp8
-rw-r--r--platform/windows/context_gl_win.h10
-rw-r--r--platform/windows/godot_win.cpp2
-rw-r--r--platform/windows/os_windows.cpp64
-rw-r--r--platform/windows/os_windows.h28
5 files changed, 56 insertions, 56 deletions
diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp
index e671101432..ab66b81421 100644
--- a/platform/windows/context_gl_win.cpp
+++ b/platform/windows/context_gl_win.cpp
@@ -31,7 +31,7 @@
//
// C++ Implementation: context_gl_x11
//
-// Description:
+// Description:
//
//
// Author: Juan Linietsky <reduzio@gmail.com>, (C) 2008
@@ -105,21 +105,21 @@ Error ContextGL_Win::initialize() {
PFD_DRAW_TO_WINDOW | // Format Must Support Window
PFD_SUPPORT_OPENGL | // Format Must Support OpenGL
PFD_DOUBLEBUFFER,
- PFD_TYPE_RGBA,
+ PFD_TYPE_RGBA,
24,
0, 0, 0, 0, 0, 0, // Color Bits Ignored
0,// No Alpha Buffer
0,// Shift Bit Ignored
0,// No Accumulation Buffer
0, 0, 0, 0,// Accumulation Bits Ignored
- 24,// 24Bit Z-Buffer (Depth Buffer)
+ 24,// 24Bit Z-Buffer (Depth Buffer)
0,// No Stencil Buffer
0,// No Auxiliary Buffer
PFD_MAIN_PLANE, // Main Drawing Layer
0,// Reserved
0, 0, 0 // Layer Masks Ignored
};
-
+
if (!(hDC=GetDC(hWnd))) {
MessageBox(NULL,"Can't Create A GL Device Context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return ERR_CANT_CREATE; // Return FALSE
diff --git a/platform/windows/context_gl_win.h b/platform/windows/context_gl_win.h
index af15ad2659..055e0b2f51 100644
--- a/platform/windows/context_gl_win.h
+++ b/platform/windows/context_gl_win.h
@@ -30,7 +30,7 @@
//
// C++ Interface: context_gl_x11
//
-// Description:
+// Description:
//
//
// Author: Juan Linietsky <reduzio@gmail.com>, (C) 2008
@@ -62,14 +62,14 @@ public:
virtual void release_current();
virtual void make_current();
-
+
virtual int get_window_width();
virtual int get_window_height();
virtual void swap_buffers();
-
+
virtual Error initialize();
-
-
+
+
ContextGL_Win(HWND hwnd,bool p_opengl_3_context);
~ContextGL_Win();
diff --git a/platform/windows/godot_win.cpp b/platform/windows/godot_win.cpp
index fa7989c726..c89d02bb05 100644
--- a/platform/windows/godot_win.cpp
+++ b/platform/windows/godot_win.cpp
@@ -179,5 +179,5 @@ HINSTANCE godot_hinstance = NULL;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
godot_hinstance = hInstance;
- return main(0,NULL);
+ return main(0,NULL);
}
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 95a6a6ac58..cad14430e6 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -178,9 +178,9 @@ void OS_Windows::initialize_core() {
maximized=false;
minimized=false;
- ThreadWindows::make_default();
- SemaphoreWindows::make_default();
- MutexWindows::make_default();
+ ThreadWindows::make_default();
+ SemaphoreWindows::make_default();
+ MutexWindows::make_default();
FileAccess::make_default<FileAccessWindows>(FileAccess::ACCESS_RESOURCES);
FileAccess::make_default<FileAccessWindows>(FileAccess::ACCESS_USERDATA);
@@ -193,7 +193,7 @@ void OS_Windows::initialize_core() {
TCPServerWinsock::make_default();
StreamPeerWinsock::make_default();
PacketPeerUDPWinsock::make_default();
-
+
mempool_static = new MemoryPoolStaticMalloc;
#if 1
mempool_dynamic = memnew( MemoryPoolDynamicStatic );
@@ -203,7 +203,7 @@ void OS_Windows::initialize_core() {
mempool_dynamic = memnew( MemoryPoolDynamicPrealloc(buffer,DYNPOOL_SIZE) );
#endif
-
+
// We need to know how often the clock is updated
if( !QueryPerformanceFrequency((LARGE_INTEGER *)&ticks_per_second) )
ticks_per_second = 1000;
@@ -426,7 +426,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) {
if (main_loop)
input->parse_input_event(event);
-
+
} break;
case WM_LBUTTONDOWN:
@@ -476,7 +476,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) {
} break;
case WM_MBUTTONUP: {
mb.pressed=false;
- mb.button_index=3;
+ mb.button_index=3;
} break;
case WM_RBUTTONDOWN: {
mb.pressed=true;
@@ -551,7 +551,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) {
mb.button_mask|=(wParam&MK_XBUTTON1)?(1<<5):0;
mb.button_mask|=(wParam&MK_XBUTTON2)?(1<<6):0;*/
mb.x=GET_X_LPARAM(lParam);
- mb.y=GET_Y_LPARAM(lParam);
+ mb.y=GET_Y_LPARAM(lParam);
if (mouse_mode==MOUSE_MODE_CAPTURED) {
@@ -822,11 +822,11 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_
outside=true;
WNDCLASSEXW wc;
-
+
video_mode=p_desired;
//printf("**************** desired %s, mode %s\n", p_desired.fullscreen?"true":"false", video_mode.fullscreen?"true":"false");
RECT WindowRect;
-
+
WindowRect.left=0;
WindowRect.right=video_mode.width;
WindowRect.top=0;
@@ -840,18 +840,18 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_
wc.cbWndExtra= 0;
//wc.hInstance = hInstance;
wc.hInstance = godot_hinstance ? godot_hinstance : GetModuleHandle(NULL);
- wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
+ wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
wc.hCursor = NULL;//LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = NULL;
- wc.lpszMenuName = NULL;
+ wc.lpszMenuName = NULL;
wc.lpszClassName = L"Engine";
if (!RegisterClassExW(&wc)) {
MessageBox(NULL,"Failed To Register The Window Class.","ERROR",MB_OK|MB_ICONEXCLAMATION);
- return; // Return
+ return; // Return
}
-
-
+
+
EnumDisplayMonitors(NULL,NULL,MonitorEnumProc,0);
print_line("DETECTED MONITORS: "+itos(monitor_info.size()));
@@ -861,7 +861,7 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_
DEVMODE current;
memset(&current,0,sizeof(current));
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &current);
-
+
WindowRect.right = current.dmPelsWidth;
WindowRect.bottom = current.dmPelsHeight;
@@ -888,7 +888,7 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_
dwExStyle=WS_EX_APPWINDOW;
dwStyle=WS_POPUP;
-
+
} else {
dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
dwStyle=WS_OVERLAPPEDWINDOW;
@@ -937,7 +937,7 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_
};
-
+
#if defined(OPENGL_ENABLED) || defined(GLES2_ENABLED) || defined(LEGACYGL_ENABLED)
gl_context = memnew( ContextGL_Win(hWnd,false) );
gl_context->initialize();
@@ -981,7 +981,7 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_
*/
- visual_server->init();
+ visual_server->init();
input = memnew( InputDefault );
joystick = memnew (joystick_windows(input, &hWnd));
@@ -1280,7 +1280,7 @@ OS::VideoMode OS_Windows::get_video_mode(int p_screen) const {
}
void OS_Windows::get_fullscreen_mode_list(List<VideoMode> *p_list,int p_screen) const {
-
+
}
int OS_Windows::get_screen_count() const {
@@ -1714,18 +1714,18 @@ void OS_Windows::delay_usec(uint32_t p_usec) const {
Sleep(1);
else
Sleep(p_usec / 1000);
-
+
}
uint64_t OS_Windows::get_ticks_usec() const {
uint64_t ticks;
- uint64_t time;
+ uint64_t time;
// This is the number of clock ticks since start
if( !QueryPerformanceCounter((LARGE_INTEGER *)&ticks) )
ticks = (UINT64)timeGetTime();
// Divide by frequency to get the time in seconds
time = ticks * 1000000L / ticks_per_second;
- // Subtract the time at game start to get
+ // Subtract the time at game start to get
// the time since the game started
time -= ticks_start;
return time;
@@ -1737,13 +1737,13 @@ void OS_Windows::process_events() {
MSG msg;
last_id = joystick->process_joysticks(last_id);
-
+
while(PeekMessageW(&msg,NULL,0,0,PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessageW(&msg);
-
+
}
process_key_events();
@@ -2034,21 +2034,21 @@ void OS_Windows::run() {
if (!main_loop)
return;
-
+
main_loop->init();
-
+
uint64_t last_ticks=get_ticks_usec();
-
+
int frames=0;
uint64_t frame=0;
-
+
while (!force_quit) {
-
+
process_events(); // get rid of pending events
if (Main::iteration()==true)
break;
};
-
+
main_loop->finish();
}
@@ -2156,7 +2156,7 @@ OS_Windows::OS_Windows(HINSTANCE _hInstance) {
}
-OS_Windows::~OS_Windows()
+OS_Windows::~OS_Windows()
{
#ifdef STDOUT_FILE
fclose(stdo);
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index ab4acf312c..28bb30b370 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -138,27 +138,27 @@ class OS_Windows : public OS {
void _touch_event(bool p_pressed, int p_x, int p_y, int idx);
// functions used by main to initialize/deintialize the OS
-protected:
+protected:
virtual int get_video_driver_count() const;
virtual const char * get_video_driver_name(int p_driver) const;
-
+
virtual VideoMode get_default_video_mode() const;
-
+
virtual int get_audio_driver_count() const;
virtual const char * get_audio_driver_name(int p_driver) const;
-
+
virtual void initialize_core();
virtual void initialize(const VideoMode& p_desired,int p_video_driver,int p_audio_driver);
-
- virtual void set_main_loop( MainLoop * p_main_loop );
+
+ virtual void set_main_loop( MainLoop * p_main_loop );
virtual void delete_main_loop();
-
+
virtual void finalize();
virtual void finalize_core();
-
+
void process_events();
void process_key_events();
-
+
struct ProcessInfo {
STARTUPINFO si;
@@ -200,7 +200,7 @@ public:
virtual Point2 get_mouse_pos() const;
virtual int get_mouse_button_state() const;
virtual void set_window_title(const String& p_title);
-
+
virtual void set_video_mode(const VideoMode& p_video_mode,int p_screen=0);
virtual VideoMode get_video_mode(int p_screen=0) const;
virtual void get_fullscreen_mode_list(List<VideoMode> *p_list,int p_screen=0) const;
@@ -226,7 +226,7 @@ public:
virtual MainLoop *get_main_loop() const;
virtual String get_name();
-
+
virtual Date get_date(bool utc) const;
virtual Time get_time(bool utc) const;
virtual TimeZoneInfo get_time_zone_info() const;
@@ -236,12 +236,12 @@ public:
virtual bool can_draw() const;
virtual Error set_cwd(const String& p_cwd);
- virtual void delay_usec(uint32_t p_usec) const;
+ virtual void delay_usec(uint32_t p_usec) const;
virtual uint64_t get_ticks_usec() const;
virtual Error execute(const String& p_path, const List<String>& p_arguments,bool p_blocking,ProcessID *r_child_id=NULL,String* r_pipe=NULL,int *r_exitcode=NULL);
virtual Error kill(const ProcessID& p_pid);
-
+
virtual bool has_environment(const String& p_var) const;
virtual String get_environment(const String& p_var) const;
@@ -273,7 +273,7 @@ public:
virtual bool is_joy_known(int p_device);
virtual String get_joy_guid(int p_device) const;
- OS_Windows(HINSTANCE _hInstance);
+ OS_Windows(HINSTANCE _hInstance);
~OS_Windows();
};