Can you show the actual code you use to do this. Also do you have any info about the computers that have this problem, do they have multiple monitors or anything? Seeing your full initialisation code will help.
Just standard stuff, like a laptop, no suspicious features (except posession of the Win 8.1 ). Besides, I use it on dual monitors without problems, so unles Win 8.1 handles it differently it should not be the problem.
The code (yes, I know it's messy ):
int easydrawInit(int w, int h,int fullscreen,int enableaudio)
{
Config.screenwidth=w; Config.screenheight=h; Config.fullscreen=fullscreen;
EasyDrawSystem.gldrawpixelsmode=0; // Always in this version!
int enablevsync=Config.vsync;
if(!enablevsync) Debug("Vsync disabled.\n");
//SDL_putenv("SDL_VIDEODRIVER=directx"); //! PORTABILITY PROBLEM !
//SDL_putenv("SDL_VIDEODRIVER=opengl"); //! PORTABILITY PROBLEM !
//SDL_SetEnv(SDL_VIDEODRIVER,"directx");
//SDL_envvars();
//SDL_SetHint(SDL_HINT_RENDER_VSYNC,0);
//SDL_putenv("SDL_VIDEO_CENTERED=center");
//SDL_SetHint(SDL_HINT_RENDER_VSYNC,0);
//SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL, 0 );
if(enableaudio) {if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0 ) return 0;}
else {if(SDL_Init(SDL_INIT_VIDEO) < 0 ) return 0;}
SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8 );
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8 );
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8 );
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL, 1 );
if(strlen(SDL_GetError())) {Debug("easydrawInit() '%s'",SDL_GetError()); SDL_ClearError();}
// Create an application window with the following settings:
int flags=SDL_WINDOW_OPENGL;
if(fullscreen==0) flags|=SDL_WINDOW_RESIZABLE;
if(fullscreen==2) flags|=SDL_WINDOW_FULLSCREEN;
//if(fullscreen==1) flags|=SDL_WINDOW_FULLSCREEN_DESKTOP;
if(fullscreen==1) flags|=SDL_WINDOW_BORDERLESS;
if(fullscreen==1)
{
SDL_DisplayMode dm;
if(SDL_GetDesktopDisplayMode(0, &dm) != 0) {Log.e("easydrawInit() SDL_GetDesktopDisplayMode failed: %s", SDL_GetError());}
Config.screenwidth=dm.w;
Config.screenheight=dm.h;
}
if(fullscreen<0 || fullscreen>2) {Log.fe("easydrawInit() invalid 'fullscreen' param.\n");}
sdlWindow = SDL_CreateWindow("Unnamed window",SDL_WINDOWPOS_UNDEFINED,SDL_WINDOWPOS_UNDEFINED, Config.screenwidth,Config.screenheight, flags); // will be renamed in UpdateWindow below
if(sdlWindow==NULL) {Debug("Could not create window: %s\n", SDL_GetError()); return 0;}
SDL_SetWindowMinimumSize(sdlWindow,Config.minscreenwidth,Config.minscreenheight);
SDL_GLContext glcontext = SDL_GL_CreateContext(sdlWindow);
SDL_GL_SetSwapInterval( enablevsync );
easydrawUpdateWindow(); // set OpenGL, set window icon, etc
Config.newscreenwidth=Config.screenwidth; Config.newscreenheight=Config.screenheight; Config.newfullscreen=Config.fullscreen; Config.newvsync=Config.vsync; Config.newconfinemousetowindow=Config.confinemousetowindow;
//char buf[256]; SDL_VideoDriverName(buf,256); Debug("VideoDriverName: %s\n",buf);
Debug("Screen Opened %dx%d Fullscreen:%d Flags:%d\n",Config.screenwidth,Config.screenheight, Config.fullscreen,flags);
Debug("Platform: %s\n", SDL_GetPlatform());
Debug("OpenGL Vendor: %s\n", glGetString( GL_VENDOR ) );
Debug("OpenGL Renderer: %s\n", glGetString( GL_RENDERER ) );
Debug("OpenGL Version: %s\n", glGetString( GL_VERSION ) );
//Debug("OpenGL Extensions : %s\n", glGetString( GL_EXTENSIONS ) );
int value; SDL_GL_GetAttribute( SDL_GL_ACCELERATED_VISUAL, &value ); Debug("SDL_GL_ACCELERATED_VISUAL: %d\n", value );
//SDL_GL_GetAttribute( SDL_GL_SWAP_CONTROL, &value ); Debug("SDL_GL_SWAP_CONTROL: %d\n", value );
//const SDL_VideoInfo* ptr = SDL_GetVideoInfo(); Debug("VRAM: %dKb\n",ptr->video_mem); Debug("SDL Hardware acceleration status: %d,%d,%d,%d\n",ptr->hw_available, ptr->blit_hw, ptr->blit_hw_A, ptr->blit_hw_CC);
Debug("OpenGLExtension GL_ARB_texture_rectangle: %d\n", easydrawINTERNAL_glQueryExtension("GL_ARB_texture_rectangle"));
Debug("OpenGLExtension ARB_texture_non_power_of_two: %d\n", easydrawINTERNAL_glQueryExtension("ARB_texture_non_power_of_two"));
//GLint texture_units; glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &texture_units); Debug("GL_MAX_TEXTURE_IMAGE_UNITS: %d\n", texture_units); // per shader?
//GLint combined_texture_units; glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &combined_texture_units); Debug("GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: %d\n", combined_texture_units); // total?
GLint texSize; glGetIntegerv(GL_MAX_TEXTURE_SIZE, &texSize); Debug("OpenGL Max texture size: %d\n", texSize);
//GLint maxLights; glGetIntegerv(GL_MAX_LIGHTS , &maxLights); Debug("OpenGL MAX_LIGHTS: %d\n", maxLights);
Debug("VideoDriver: %s\n",SDL_GetCurrentVideoDriver());
Debug("NumVideoDrivers: %d NumVideoModes: %d NumDisplayModes: %d\n",SDL_GetNumVideoDrivers(),SDL_GetNumVideoDisplays(),SDL_GetNumDisplayModes(0));
//Debug("[config] glDrawPixelsMode: %d\n",EasyDrawSystem.gldrawpixelsmode);
Debug("Number of logical CPU cores: %d\nSystem Memory: %d MB\n", SDL_GetCPUCount(),SDL_GetSystemRAM());
SDL_version compiled_version,link_version; SDL_VERSION(&compiled_version); SDL_GetVersion(&link_version);
Debug("SDL_version - CompiledVersion: %d.%d.%d ", compiled_version.major,compiled_version.minor,compiled_version.patch);
Debug("LinkedVersion: %d.%d.%d\n", link_version.major, link_version.minor, link_version.patch);
//Initialize PNG loading
#ifdef EASYDRAW_ENABLE_SDLIMAGE
{
int imgFlags = IMG_INIT_PNG;
if(!(IMG_Init(imgFlags) & imgFlags)) {Debug( "SDL_image could not initialize! SDL_image Error: %s\n",IMG_GetError());}
SDL_version compile_version; SDL_IMAGE_VERSION(&compile_version); const SDL_version *link_version=IMG_Linked_Version();
Debug("SDL_image_version - CompiledVersion: %d.%d.%d ", compile_version.major, compile_version.minor, compile_version.patch);
Debug("LinkedVersion: %d.%d.%d\n", link_version->major, link_version->minor, link_version->patch);
}
#endif
//Config.logeasydraw=Config.logfont=1; Debug("[notice] Changed Config to allow logging (in easydrawInit()).\n");
if(!Config.logeasydraw) Debug("Disabled log easydraw.\n");
if(!Config.logfont) Debug("Disabled log font.\n");
if(strlen(SDL_GetError())) {Debug("easydrawInit() '%s'",SDL_GetError()); SDL_ClearError();}
return 1;
}
void easydrawUpdateWindow() // Run it after window resize/screen resolution change
{
/*
1. GL clear, GL hints, GL viewport, GL perspective, etc
2. SDL_SetWindowTitle(sdlWindow,buf);
3. SDL_SetWindowIcon()
4. SDL_SetWindowGrab(sdlWindow,SDL_FALSE);
*/
int width=Config.screenwidth; int height=Config.screenheight;
Debug("easydrawUpdateWindow(%dx%d)\n",width,height);
// OpenGL
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glEnable(GL_BLEND); // Turn Blending On
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glShadeModel(GL_SMOOTH);
glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do
glClearDepth(1.0f); // Depth Buffer Setup
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective
/* Our shading model--Gouraud (smooth). */
glShadeModel( GL_SMOOTH );
/* Culling. */
glCullFace( GL_BACK );
glFrontFace( GL_CCW );
glEnable( GL_CULL_FACE );
/* Set the clear color. */
glClearColor( 0, 0, 0, 0 );
/* Setup our viewport. */
glViewport( 0, 0, width, height );
/* Change to the projection matrix and set our viewing volume. */
glMatrixMode( GL_PROJECTION );
glLoadIdentity( );
float ratio = (float) width / (float) height;
gluPerspective( 60, ratio, 1.0, 1024.0 );
// SDL (app icon and window name)
char buf[256]; snprintf(buf,255,"%s %s",GAMENAME,GAMEVERSION); SDL_SetWindowTitle(sdlWindow,buf);
SDL_SetWindowIcon(sdlWindow,IMG_Load("data/images/system/icon.png"));
// Window grab (confine mouse to window)
if(Config.confinemousetowindow && Config.fullscreen!=0) SDL_SetWindowGrab(sdlWindow,SDL_TRUE); else SDL_SetWindowGrab(sdlWindow,SDL_FALSE);
if(strlen(SDL_GetError())) {Debug("easydrawUpdateWindow() '%s'",SDL_GetError()); SDL_ClearError();}
}