I'm in need of a bit of advice on how to implement hardware acceleration when I drag a window over to another monitor. Using this code from my previous tests with WinApi's whenever I drag a window onto the secondary monitor the framerate drops considerably. Looking through various forums off this site I've found that other monitors are classed as separate devices. Is there a way to initialise the second monitor so I can get a full fps count the same as the main one?
// Dark GDK - The Game Creators - www.thegamecreators.com
#include "DarkGDK.h"
#include "resource.h"
int app_pause=FALSE;
int app_scene_change=NULL;
int app_quit=FALSE;
#include "winapistuff.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
float angleX=0.00, angleY=0.00, angleZ=0.00;
float anginX=1.03, anginY=0.87, anginZ=1.21;
char mytext[100];
char val[2]="0";
HWND mydialog=NULL;
// size and position of GDK's main window (my monitor is left < that way)
//dbSetWindowLayout(0,0,0);
dbSetWindowPosition(0,0);
dbSetDisplayMode(1024,768,0);
dbSetWindowSize(1024,768);
dbSetWindowOn();
if (mydialog=CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG1),NULL,myDialogProc))
{
ShowWindow(mydialog, SW_SHOW);
// at this point I can allow the App run on (not yet though)
}
dbSyncOn ( );
dbSyncRate ( 0 );
dbMakeObjectCube(1,10);
while ( LoopGDK ( ) && app_quit==FALSE)
{
if (app_pause==FALSE)
{
dbRotateObject(1,angleX,angleY,angleZ);
angleX=dbWrapValue(angleX+anginX);
angleY=dbWrapValue(angleY+anginY);
angleZ=dbWrapValue(angleZ+anginZ);
}
if (app_scene_change!=NULL)
{
switch (app_scene_change)
{
case 1:
dbDeleteObject(1);
dbMakeObjectCube(1,100);
break;
case 2:
dbDeleteObject(1);
dbMakeObjectSphere(1,100);
break;
}
app_scene_change=NULL;
}
GetDlgItemText(mydialog,IDC_EDIT1,mytext,100);
dbText(0,0,mytext);
if (dbScreenType() == 0) {
val[0]=48; }
else {
val[0]=49; }
dbText(0,8,val);
dbSync ( );
}
// return back to windows
return;
}
I've even used dbScreenType() to determine whether the screen is hardware accelerated and on either screen it shows up that it is.
I am assuming it is a windows issue with monitors being separate devices but if anyone has any ideas please let me know. I'm currently using an Advent 8117 laptop with GMA 950 graphics.
Warning! May contain Nuts!