void OglDoFullScreenInternal(void){ if (GLPREF_windowed==gameStates.ogl.bFullScreen){ OglDestroyWindow(); win32_create_window(GLPREF_width,GLPREF_height); ogl_vivify_texture_list_internal(); } }
void OglDoFullScreenInternal(void){ if (GLPREF_windowed==gameStates.ogl.bFullScreen){ OglDestroyWindow(); win32_create_window(GLPREF_width,GLPREF_height); OglVivifyTextureListInternal(); } }
int OglInitWindow(int x, int y){ GLPREF_width=x; GLPREF_height=y; if (gameStates.ogl.bInitialized){ if (GLSTATE_width==GLPREF_width && GLSTATE_height==GLPREF_height && GLPREF_windowed!=gameStates.ogl.bFullScreen) return 0;//we are already in the right mode, don't do anything. if (!gameStates.ogl.bFullScreen && GLPREF_windowed){ SetWindowPos(g_hWnd,0,0,0,x+get_win_x_bs(),y+get_win_y_bs(),SWP_NOMOVE); }else{ OglDestroyWindow(); win32_create_window(x,y); ogl_vivify_texture_list_internal(); } }else { win32_create_window(x,y); } return 0; }
void * win32_window_create_window( xwl_native_window_t * handle, const char * utf8_title, unsigned int * attributes, int pixel_format ) { HWND native_handle; int window_width; int window_height; int use_fullscreen; int window_x, window_y; window_width = attributes[ XWL_WINDOW_WIDTH ]; window_height = attributes[ XWL_WINDOW_HEIGHT ]; use_fullscreen = attributes[ XWL_USE_FULLSCREEN ]; window_x = attributes[ XWL_WINDOW_X ]; window_y = attributes[ XWL_WINDOW_Y ]; if ( !_win32ChoosePixelFormatARB && !_win32CreateContextAttribsARB ) { HWND dummy_window = win32_create_dummy_window(); if ( dummy_window ) { win32_load_symbols( dummy_window ); DestroyWindow( dummy_window ); } } native_handle = win32_create_window( utf8_title, (HICON)attributes[ XWL_WIN32_ICON ], (HICON)attributes[ XWL_WIN32_ICONSM ], window_x, window_y, window_width, window_height, use_fullscreen, attributes[XWL_DISABLE_RESIZE] ); if ( native_handle ) { // store native window handle data SetWindowLongPtrA( native_handle, GWLP_USERDATA, (LONG)&handle->handle); // if visible ShowWindow( native_handle, SW_SHOW ); SetForegroundWindow( native_handle ); UpdateWindow( native_handle ); // //GetClientRect( native_handle, &clientrect ); // TODO: This is a hack because Windows requires the pixel format to come after window creation // and the current order of processes in xwl has pixel format being queried before. // Perhaps a solution is to offer both a pre- and post- window callback. handle->handle.pixel_format = win32_opengl_setup_pixelformat( handle, native_handle, attributes ); } return (void*)native_handle; } // win32_window_create_window
HWND win32_create_dummy_window() { return win32_create_window( "dummy_window", 0, 0, 0, 0, 100, 100, 0, 0 ); } // win32_create_dummy_window