paragui-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-cvs] CVS: paragui/test animation.cpp,1.2.2.5,1.2.2.6 dblbuffer.


From: Teunis Peters <address@hidden>
Subject: [paragui-cvs] CVS: paragui/test animation.cpp,1.2.2.5,1.2.2.6 dblbuffer.cpp,1.4.2.11,1.4.2.12 stress1.cpp,1.2.2.1,1.2.2.2 stress2.cpp,1.2.2.1,1.2.2.2
Date: Sun, 26 Jan 2003 16:27:42 -0500

Update of /cvsroot/paragui/paragui/test
In directory subversions:/tmp/cvs-serv7675/test

Modified Files:
      Tag: devel-opengl
        animation.cpp dblbuffer.cpp stress1.cpp stress2.cpp 
Log Message:
fixed many opengl driver bugs.  Most things now work - although spotting 
colourkeying still doesn't.


Index: animation.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/test/animation.cpp,v
retrieving revision 1.2.2.5
retrieving revision 1.2.2.6
diff -C2 -r1.2.2.5 -r1.2.2.6
*** animation.cpp       30 Oct 2002 09:16:29 -0000      1.2.2.5
--- animation.cpp       26 Jan 2003 21:27:20 -0000      1.2.2.6
***************
*** 19,22 ****
--- 19,23 ----
  #include "pglog.h"
  #include "pgdraw.h"
+ #include "pgdriver.h"
  
  #define ID_APP_EXIT           1
***************
*** 227,237 ****
        // every ParaGUI application need an application-object
        PG_Application& app = PG_Application::GetInstance();
  
        // let us escape with "ESC"
        app.SetEmergencyQuit(true);
        
!       // every application needs a theme (the look & feel of the widgets)
!       app.LoadTheme("default");
!       //app.LoadTheme("simple");
  
        // we must initialize the screen where we want to draw on
--- 228,266 ----
        // every ParaGUI application need an application-object
        PG_Application& app = PG_Application::GetInstance();
+       PG_VideoDriver* gldriver = NULL;
  
        // let us escape with "ESC"
        app.SetEmergencyQuit(true);
        
!       while ( argc > 1 ) {
!         --argc;
! #ifdef HAVE_OPENGL
!               if(strcmp(argv[argc], "-gl") == 0) {
!                 PG_LogMSG("Initializing OpenGL driver\n");
!                 gldriver = new PG_VideoDriver(app, PG_GLVIDEO);
!               }
! #endif
! #ifdef HAVE_DUMMYVIDEO
!               if(strcmp(argv[argc], "-dummy") == 0) {
!                 PG_LogMSG("Initializing Dummy driver\n");
!                 gldriver = new PG_VideoDriver(app, PG_DUMMYVIDEO);
!               }
! #endif
! #ifdef HAVE_DIRECTX
!               if(strcmp(argv[argc], "-DX") == 0) {
!                 PG_LogMSG("Initializing DirectX driver\n");
!                 gldriver = new PG_VideoDriver(app, PG_DXVIDEO);
!               }
! #endif
!       }
!       if (gldriver != NULL) {
!         if (gldriver->valid()) {
!           PG_LogMSG("Initializing provided graphics driver\n");
!           gldriver->attach();
!         } else {
!           PG_LogERR("graphics driver failed to initialize! - Quitting...");
!           return -1;
!         };
!       };
  
        // we must initialize the screen where we want to draw on
***************
*** 245,248 ****
--- 274,281 ----
  
        // ok - now we have a nice 640x480x16 window on the screen :)
+ 
+       // every application needs a theme (the look & feel of the widgets)
+       app.LoadTheme("default");
+       //app.LoadTheme("simple");
  
        PG_Rect rect(0, 0, 80, 30);

Index: dblbuffer.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/test/dblbuffer.cpp,v
retrieving revision 1.4.2.11
retrieving revision 1.4.2.12
diff -C2 -r1.4.2.11 -r1.4.2.12
*** dblbuffer.cpp       17 Jan 2003 23:13:08 -0000      1.4.2.11
--- dblbuffer.cpp       26 Jan 2003 21:27:20 -0000      1.4.2.12
***************
*** 37,41 ****
  
  int LoadSprite(PG_Draw::PG_DrawableSurface *screen, char *file) {
!         // SDL_Surface *temp;
  
        /* Load the sprite image */
--- 37,41 ----
  
  int LoadSprite(PG_Draw::PG_DrawableSurface *screen, char *file) {
!         PG_Draw::PG_DrawableSurface* temp;
  
        /* Load the sprite image */
***************
*** 47,64 ****
  
        /* Set transparent pixel as the pixel at (0,0) */
!       if ( sprite->GetFormat()->palette ) {
                sprite->SetColorKey((SDL_SRCCOLORKEY|SDL_RLEACCEL),
                                    *(Uint8 *)sprite->GetPixels());
!       }
  
! #if 0 /* removed... */
        /* Convert sprite to video format */
!       temp = SDL_DisplayFormat(sprite);
!       SDL_FreeSurface(sprite);
        if ( temp == NULL ) {
!               PG_LogMSG( "Couldn't convert background: %s",
!                                                       SDL_GetError());
                return(-1);
        }
        sprite = temp;
  #endif
--- 47,63 ----
  
        /* Set transparent pixel as the pixel at (0,0) */
!       // if ( sprite->GetFormat()->palette ) {
                sprite->SetColorKey((SDL_SRCCOLORKEY|SDL_RLEACCEL),
                                    *(Uint8 *)sprite->GetPixels());
!       // }
  
! #if 1
        /* Convert sprite to video format */
!       temp = screen->GetCreator()->AccelerateSurface(sprite,true);
        if ( temp == NULL ) {
!               PG_LogMSG("Couldn't convert sprite: %s", SDL_GetError());
                return(-1);
        }
+       // delete sprite;
        sprite = temp;
  #endif

Index: stress1.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/test/stress1.cpp,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -C2 -r1.2.2.1 -r1.2.2.2
*** stress1.cpp 31 Aug 2002 04:01:25 -0000      1.2.2.1
--- stress1.cpp 26 Jan 2003 21:27:20 -0000      1.2.2.2
***************
*** 21,24 ****
--- 21,25 ----
  #include "pgmenubar.h"
  #include "pgtheme.h"
+ #include "pgdriver.h"
  
  #define RESX 800
***************
*** 38,41 ****
--- 39,43 ----
        // construct the application object
        PG_Application& app = PG_Application::GetInstance();
+       PG_VideoDriver* gldriver = NULL;
        app.SetEmergencyQuit(true);
                
***************
*** 61,74 ****
                        resy = atoi(argv[++c]);
                }
        }
  
        Uint32 start_ticks = SDL_GetTicks();
-       
-       if(!app.LoadTheme(theme)) {
-           PG_LogERR("Unable to load theme \"%s\"", theme);
-           return -1;
-       }
  
!       PG_LogMSG("Loaded theme in %i ms", SDL_GetTicks() - start_ticks);
  
        if(!app.InitScreen(resx, resy, bpp, flags)){
--- 63,98 ----
                        resy = atoi(argv[++c]);
                }
+ #ifdef HAVE_OPENGL
+               if(strcmp(argv[c], "-gl") == 0) {
+                 PG_LogMSG("Initializing OpenGL driver\n");
+                 gldriver = new PG_VideoDriver(app, PG_GLVIDEO);
+               }
+ #endif
+ 
+ #ifdef HAVE_DUMMYVIDEO
+               if(strcmp(argv[c], "-dummy") == 0) {
+                 PG_LogMSG("Initializing Dummy driver\n");
+                 gldriver = new PG_VideoDriver(app, PG_DUMMYVIDEO);
+               }
+ #endif
+ #ifdef HAVE_DIRECTX
+               if(strcmp(argv[c], "-DX") == 0) {
+                 PG_LogMSG("Initializing DirectX driver\n");
+                 gldriver = new PG_VideoDriver(app, PG_DXVIDEO);
+               }
+ #endif
        }
  
        Uint32 start_ticks = SDL_GetTicks();
  
!       if (gldriver != NULL) {
!         if (gldriver->valid()) {
!           PG_LogMSG("Initializing provided graphics driver\n");
!           gldriver->attach();
!         } else {
!           PG_LogERR("graphics driver failed to initialize! - Quitting...");
!           return -1;
!         };
!       };
  
        if(!app.InitScreen(resx, resy, bpp, flags)){
***************
*** 78,81 ****
--- 102,112 ----
  
        PG_LogMSG("screen initialized after %i ms", SDL_GetTicks() - 
start_ticks);
+       
+       if(!app.LoadTheme(theme)) {
+           PG_LogERR("Unable to load theme \"%s\"", theme);
+           return -1;
+       }
+ 
+       PG_LogMSG("Loaded theme in %i ms", SDL_GetTicks() - start_ticks);
  
        app.SetCursor(app.GetTheme()->FindSurface("Pointer", "Pointer", 
"normal"));

Index: stress2.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/test/stress2.cpp,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -C2 -r1.2.2.1 -r1.2.2.2
*** stress2.cpp 31 Aug 2002 04:01:25 -0000      1.2.2.1
--- stress2.cpp 26 Jan 2003 21:27:20 -0000      1.2.2.2
***************
*** 21,24 ****
--- 21,25 ----
  #include "pgmenubar.h"
  #include "pgtheme.h"
+ #include "pgdriver.h"
  
  #define RESX 800
***************
*** 38,41 ****
--- 39,43 ----
        // construct the application object
        PG_Application& app = PG_Application::GetInstance();
+       PG_VideoDriver* gldriver = NULL;
        app.SetEmergencyQuit(true);
                
***************
*** 61,74 ****
                        resy = atoi(argv[++c]);
                }
        }
  
        Uint32 start_ticks = SDL_GetTicks();
        
!       if(!app.LoadTheme(theme)) {
!           PG_LogERR("Unable to load theme \"%s\"", theme);
            return -1;
!       }
! 
!       PG_LogMSG("Loaded theme in %i ms", SDL_GetTicks() - start_ticks);
  
        if(!app.InitScreen(resx, resy, bpp, flags)){
--- 63,98 ----
                        resy = atoi(argv[++c]);
                }
+ #ifdef HAVE_OPENGL
+               if(strcmp(argv[c], "-gl") == 0) {
+                 PG_LogMSG("Initializing OpenGL driver\n");
+                 gldriver = new PG_VideoDriver(app, PG_GLVIDEO);
+               }
+ #endif
+ 
+ #ifdef HAVE_DUMMYVIDEO
+               if(strcmp(argv[c], "-dummy") == 0) {
+                 PG_LogMSG("Initializing Dummy driver\n");
+                 gldriver = new PG_VideoDriver(app, PG_DUMMYVIDEO);
+               }
+ #endif
+ #ifdef HAVE_DIRECTX
+               if(strcmp(argv[c], "-DX") == 0) {
+                 PG_LogMSG("Initializing DirectX driver\n");
+                 gldriver = new PG_VideoDriver(app, PG_DXVIDEO);
+               }
+ #endif
        }
  
        Uint32 start_ticks = SDL_GetTicks();
        
!       if (gldriver != NULL) {
!         if (gldriver->valid()) {
!           PG_LogMSG("Initializing provided graphics driver\n");
!           gldriver->attach();
!         } else {
!           PG_LogERR("graphics driver failed to initialize! - Quitting...");
            return -1;
!         };
!       };
  
        if(!app.InitScreen(resx, resy, bpp, flags)){
***************
*** 78,81 ****
--- 102,112 ----
  
        PG_LogMSG("screen initialized after %i ms", SDL_GetTicks() - 
start_ticks);
+ 
+       if(!app.LoadTheme(theme)) {
+           PG_LogERR("Unable to load theme \"%s\"", theme);
+           return -1;
+       }
+ 
+       PG_LogMSG("Loaded theme in %i ms", SDL_GetTicks() - start_ticks);
  
        app.SetCursor(app.GetTheme()->FindSurface("Pointer", "Pointer", 
"normal"));





reply via email to

[Prev in Thread] Current Thread [Next in Thread]