paragui-cvs
[Top][All Lists]
Advanced

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

[paragui-cvs] CVS: paragui/test Makefile.am,1.6,1.6.2.1 animation.cpp,1.


From: Teunis Peters <address@hidden>
Subject: [paragui-cvs] CVS: paragui/test Makefile.am,1.6,1.6.2.1 animation.cpp,1.2,1.2.2.1 dblbuffer.cpp,1.4,1.4.2.1 paratest.cpp,1.9,1.9.2.1 windowresize.cpp,1.1,1.1.2.1 windowtest.cpp,1.1.1.1,1.1.1.1.2.1
Date: Tue, 18 Jun 2002 18:40:42 -0400

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

Modified Files:
      Tag: devel-opengl
        Makefile.am animation.cpp dblbuffer.cpp paratest.cpp 
        windowresize.cpp windowtest.cpp 
Log Message:
Initial checkin of code by Teunis Peters
Added abstraction layer for display support.
Initial OpenGL testing mode - use SDL_GLSDL to activate
A lot of test code is still present - FIXME
Some demos do not operate at all.  Some work barely.
only animation works flawlessly at this time.


Index: Makefile.am
===================================================================
RCS file: /cvsroot/paragui/paragui/test/Makefile.am,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -r1.6 -r1.6.2.1
*** Makefile.am 30 Apr 2002 08:46:13 -0000      1.6
--- Makefile.am 18 Jun 2002 22:40:39 -0000      1.6.2.1
***************
*** 38,42 ****
        $(EXPAT_INCLUDE) \
        $(FREETYPE_CFLAGS) \
!       -I../include
  
  $(PACKAGE)-$(VERSION).tar.gz: dist
--- 38,43 ----
        $(EXPAT_INCLUDE) \
        $(FREETYPE_CFLAGS) \
!       -I../include \
!       -I$(top_srcdir)/include
  
  $(PACKAGE)-$(VERSION).tar.gz: dist

Index: animation.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/test/animation.cpp,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -r1.2 -r1.2.2.1
*** animation.cpp       27 Apr 2002 11:57:23 -0000      1.2
--- animation.cpp       18 Jun 2002 22:40:39 -0000      1.2.2.1
***************
*** 16,19 ****
--- 16,20 ----
  #include <pgmenubar.h> 
  #include <pgscrollbar.h> 
+ #include <pgdraw.h>
  
  #define ID_APP_EXIT           1
***************
*** 58,62 ****
  
        // our custom event handler to redraw our stuff
!       void eventBlit(SDL_Surface* surface, const PG_Rect& src, const PG_Rect& 
dst);
  
  private:
--- 59,63 ----
  
        // our custom event handler to redraw our stuff
!       void eventBlit(PG_Draw::PG_DrawableSurface* surface, const PG_Rect& 
src, const PG_Rect& dst);
  
  private:
***************
*** 93,99 ****
  // (fills the widget with some nice gfx)
  
! void PlayField::eventBlit(SDL_Surface* surface, const PG_Rect& src, const 
PG_Rect& dst) {
  
!       SDL_FillRect(my_srfScreen, (SDL_Rect*)&dst, 0);
        
        if (tickstate==0) {
--- 94,100 ----
  // (fills the widget with some nice gfx)
  
! void PlayField::eventBlit(PG_Draw::PG_DrawableSurface* surface, const 
PG_Rect& src, const PG_Rect& dst) {
  
!         my_srfScreen->FillRect(dst, 0);
        
        if (tickstate==0) {
***************
*** 149,153 ****
  
        // our custom event handler to redraw our stuff
!       void eventBlit(SDL_Surface* surface, const PG_Rect& src, const PG_Rect& 
dst);
  
  private:
--- 150,154 ----
  
        // our custom event handler to redraw our stuff
!       void eventBlit(PG_Draw::PG_DrawableSurface* surface, const PG_Rect& 
src, const PG_Rect& dst);
  
  private:
***************
*** 182,188 ****
  // (fills the widget with some nice gfx)
  
! void PlayField2::eventBlit(SDL_Surface* surface, const PG_Rect& src, const 
PG_Rect& dst) {
  
!       SDL_FillRect(my_srfScreen, (SDL_Rect*)&dst, 0);
        
        for (int i=0; i<3; i++)
--- 183,189 ----
  // (fills the widget with some nice gfx)
  
! void PlayField2::eventBlit(PG_Draw::PG_DrawableSurface* surface, const 
PG_Rect& src, const PG_Rect& dst) {
  
!         my_srfScreen->FillRect(dst, 0);
        
        for (int i=0; i<3; i++)
***************
*** 211,216 ****
        temp_color.b = (my_color.b * tickstate)/40;
  
!       temp_int = SDL_MapRGB(my_srfScreen->format, temp_color.r, temp_color.g, 
temp_color.b);
!       SDL_FillRect(my_srfScreen, (SDL_Rect *)&temp_rect, temp_int);
  }
  
--- 212,217 ----
        temp_color.b = (my_color.b * tickstate)/40;
  
!       temp_int = SDL_MapRGB(my_srfScreen->getScreen()->format, temp_color.r, 
temp_color.g, temp_color.b);
!       my_srfScreen->FillRect(temp_rect, temp_int);
  }
  

Index: dblbuffer.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/test/dblbuffer.cpp,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -r1.4 -r1.4.2.1
*** dblbuffer.cpp       2 May 2002 09:50:40 -0000       1.4
--- dblbuffer.cpp       18 Jun 2002 22:40:39 -0000      1.4.2.1
***************
*** 9,12 ****
--- 9,13 ----
  #include "pgcheckbutton.h"
  #include "pgtheme.h"
+ #include "pgdraw.h"
  
  #include <ctime>
***************
*** 34,38 ****
  }
  
! int LoadSprite(SDL_Surface *screen, char *file)
  {
        SDL_Surface *temp;
--- 35,39 ----
  }
  
! int LoadSprite(PG_Draw::PG_DrawableSurface *screen, char *file)
  {
        SDL_Surface *temp;
***************
*** 65,72 ****
  }
  
! void MoveSprites(SDL_Surface *screen, Uint32 background)
  {
        int i, nupdates;
!       SDL_Rect area, *position, *velocity;
  
        nupdates = 0;
--- 66,74 ----
  }
  
! void MoveSprites(PG_Draw::PG_DrawableSurface *screen, Uint32 background)
  {
        int i, nupdates;
!       SDL_Rect *position, *velocity;
!       PG_Rect area;
  
        nupdates = 0;
***************
*** 77,86 ****
                velocity = &velocities[i];
                position->x += velocity->x;
!               if ( (position->x < 0) || (position->x >= screen->w) ) {
                        velocity->x = -velocity->x;
                        position->x += velocity->x;
                }
                position->y += velocity->y;
!               if ( (position->y < 0) || (position->y >= screen->h) ) {
                        velocity->y = -velocity->y;
                        position->y += velocity->y;
--- 79,88 ----
                velocity = &velocities[i];
                position->x += velocity->x;
!               if ( (position->x < 0) || (position->x >= 
screen->getScreen()->w) ) {
                        velocity->x = -velocity->x;
                        position->x += velocity->x;
                }
                position->y += velocity->y;
!               if ( (position->y < 0) || (position->y >= 
screen->getScreen()->h) ) {
                        velocity->y = -velocity->y;
                        position->y += velocity->y;
***************
*** 89,93 ****
                /* Blit the sprite onto the screen */
                area = *position;
!               SDL_BlitSurface(sprite, NULL, screen, &area);
                sprite_rects[nupdates++] = area;
        }
--- 91,95 ----
                /* Blit the sprite onto the screen */
                area = *position;
!               screen->BlitSurface(sprite, PG_Rect(), area);
                sprite_rects[nupdates++] = area;
        }
***************
*** 117,121 ****
                   causes really bad flickering.
                 */
!               if ( info->video_mem*1024 > (height*width*bpp/8) ) {
                        flags |= SDL_DOUBLEBUF;
                } else {
--- 119,123 ----
                   causes really bad flickering.
                 */
!               if ( info->video_mem*1024 > (Uint32)(height*width*bpp/8) ) {
                        flags |= SDL_DOUBLEBUF;
                } else {
***************
*** 130,134 ****
  int main(int argc, char *argv[])
  {
!       SDL_Surface *screen;
        Uint8 *mem;
        int width, height;
--- 132,136 ----
  int main(int argc, char *argv[])
  {
!         PG_Draw::PG_DrawableSurface *screen;
        Uint8 *mem;
        int width, height;
***************
*** 240,245 ****
        srand(time(NULL));
        for ( i=0; i<numsprites; ++i ) {
!               positions[i].x = rand()%screen->w;
!               positions[i].y = rand()%screen->h;
                positions[i].w = sprite->w;
                positions[i].h = sprite->h;
--- 242,247 ----
        srand(time(NULL));
        for ( i=0; i<numsprites; ++i ) {
!               positions[i].x = rand()%screen->getScreen()->w;
!               positions[i].y = rand()%screen->getScreen()->h;
                positions[i].w = sprite->w;
                positions[i].h = sprite->h;
***************
*** 251,264 ****
                }
        }
!       background = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
  
        /* Print out information about our surfaces */
!       PG_LogMSG("Screen is at %d bits per 
pixel",screen->format->BitsPerPixel);
!       if ( (screen->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
                PG_LogMSG("Screen is in video memory");
        } else {
                PG_LogMSG("Screen is in system memory");
        }
!       if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
                PG_LogMSG("Screen has double-buffering enabled");
        }
--- 253,266 ----
                }
        }
!       background = SDL_MapRGB(screen->getScreen()->format, 0x00, 0x00, 0x00);
  
        /* Print out information about our surfaces */
!       PG_LogMSG("Screen is at %d bits per 
pixel",screen->getScreen()->format->BitsPerPixel);
!       if ( (screen->getScreen()->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
                PG_LogMSG("Screen is in video memory");
        } else {
                PG_LogMSG("Screen is in system memory");
        }
!       if ( (screen->getScreen()->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
                PG_LogMSG("Screen has double-buffering enabled");
        }
***************
*** 269,279 ****
        }
        /* Run a sample blit to trigger blit acceleration */
!       { SDL_Rect dst;
!               dst.x = 0;
!               dst.y = 0;
!               dst.w = sprite->w;
!               dst.h = sprite->h;
!               SDL_BlitSurface(sprite, NULL, screen, &dst);
!               SDL_FillRect(screen, &dst, background);
        }
        if ( (sprite->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
--- 271,277 ----
        }
        /* Run a sample blit to trigger blit acceleration */
!       { PG_Rect dst = PG_Rect(0,0,sprite->w,sprite->h);
!               screen->BlitSurface(sprite, PG_Rect(), dst);
!               screen->FillRect(dst, background);
        }
        if ( (sprite->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
***************
*** 318,322 ****
                /* Erase all the sprites if necessary */
                if ( sprites_visible ) {
!                       SDL_FillRect(screen, NULL, background);
                }
                
--- 316,320 ----
                /* Erase all the sprites if necessary */
                if ( sprites_visible ) {
!                       screen->FillRect(PG_Rect(), background);
                }
                
***************
*** 329,339 ****
                        PG_Widget::BulkBlit();
                }
                /* Update the screen! */
!               if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
!                       SDL_Flip(screen);
                } else {
!                       SDL_UpdateRect(screen, 0,0,0,0);
                        //SDL_UpdateRects(screen, nupdates, sprite_rects);
                }
        }
        SDL_FreeSurface(sprite);
--- 327,345 ----
                        PG_Widget::BulkBlit();
                }
+               PG_Application::GetDrawingEnvironment()->Flip();
+ #if 0
                /* Update the screen! */
!               if ( (screen->getScreen()->flags & SDL_DOUBLEBUF) == 
SDL_DOUBLEBUF ) {
!                       PG_Application::GetDrawingEnvironment()->Flip();
                } else {
!                       PG_Rect r;
!                       screen->UpdateRects(1, &r);
!                       // PG_Application::GetDrawingEnvironment()->Flip();
                        //SDL_UpdateRects(screen, nupdates, sprite_rects);
+                       // glFlush();   /* Just in case. *heh* */
+                       // SDL_GL_SwapBuffers();
+                       // glFinish();  /* And here we kill parallel 
execution... :-( */
                }
+ #endif
        }
        SDL_FreeSurface(sprite);

Index: paratest.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/test/paratest.cpp,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -C2 -r1.9 -r1.9.2.1
*** paratest.cpp        6 May 2002 11:18:03 -0000       1.9
--- paratest.cpp        18 Jun 2002 22:40:39 -0000      1.9.2.1
***************
*** 73,76 ****
--- 73,77 ----
        /** a new style callback member */
        bool handle_show_window(PG_Button* button) {
+ fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
                Show(true);
                return true;
***************
*** 80,84 ****
        bool handle_slide_btntrans(PG_Slider* slider, long pos, PG_Pointer* 
data) {
                PG_Button* b = static_cast<PG_Button*>(data);
!               
                // set transparency of passed in button
                b->SetTransparency((Uint8)pos, (Uint8)pos, (Uint8)pos);
--- 81,85 ----
        bool handle_slide_btntrans(PG_Slider* slider, long pos, PG_Pointer* 
data) {
                PG_Button* b = static_cast<PG_Button*>(data);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);              
                // set transparency of passed in button
                b->SetTransparency((Uint8)pos, (Uint8)pos, (Uint8)pos);
***************
*** 107,110 ****
--- 108,112 ----
  PG_Window(parent, r, windowtext, WF_SHOW_CLOSE | WF_SHOW_MINIMIZE)
  {
+ fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        WidgetList = new PG_WidgetList(this, PG_Rect(30, 40, 220, 250));
        WidgetList->SetDirtyUpdate(false);
***************
*** 112,135 ****
        WidgetList->SetBackground("default/wnd_close.bmp", BKMODE_TILE, 0xFF);
        WidgetList->SetBackgroundBlend(0);
!                       
        WidgetList->EnableScrollBar(true, PG_SB_VERTICAL);
        WidgetList->EnableScrollBar(true, PG_SB_HORIZONTAL);
!               
        PG_Button* add = new PG_Button(this, 100, PG_Rect(260,130,110,30), "<< 
ADD");
        add->sigButtonClick.connect(slot(*this, &TestWindow::handleButton));
!       
        PG_Button* remove = new PG_Button(this, 101, PG_Rect(260,165,110,30), 
">> REMOVE");
        remove->sigButtonClick.connect(slot(*this, &TestWindow::handleButton));
!       
        PG_Button* b = new PG_Button(NULL, BTN_ID_YES, PG_Rect(0,0, 400,50), 
"YES");
        b->SetTransparency(128,128,128);
        b->SetFontName("qnx/font.ttf");
        WidgetList->AddWidget(b);
! 
        PG_Slider* s = new PG_Slider(NULL, 20, PG_Rect(0, 0, 200,20), 
PG_SB_HORIZONTAL);
        s->SetRange(0,255);
        s->SetTransparency(200);
        s->SetPosition(50);
! 
        s->sigSlide.connect(slot(*this, &TestWindow::handle_slide_btntrans), b);
  
--- 114,137 ----
        WidgetList->SetBackground("default/wnd_close.bmp", BKMODE_TILE, 0xFF);
        WidgetList->SetBackgroundBlend(0);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        WidgetList->EnableScrollBar(true, PG_SB_VERTICAL);
        WidgetList->EnableScrollBar(true, PG_SB_HORIZONTAL);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);              
        PG_Button* add = new PG_Button(this, 100, PG_Rect(260,130,110,30), "<< 
ADD");
        add->sigButtonClick.connect(slot(*this, &TestWindow::handleButton));
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);      
        PG_Button* remove = new PG_Button(this, 101, PG_Rect(260,165,110,30), 
">> REMOVE");
        remove->sigButtonClick.connect(slot(*this, &TestWindow::handleButton));
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);      
        PG_Button* b = new PG_Button(NULL, BTN_ID_YES, PG_Rect(0,0, 400,50), 
"YES");
        b->SetTransparency(128,128,128);
        b->SetFontName("qnx/font.ttf");
        WidgetList->AddWidget(b);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_Slider* s = new PG_Slider(NULL, 20, PG_Rect(0, 0, 200,20), 
PG_SB_HORIZONTAL);
        s->SetRange(0,255);
        s->SetTransparency(200);
        s->SetPosition(50);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        s->sigSlide.connect(slot(*this, &TestWindow::handle_slide_btntrans), b);
  
***************
*** 166,174 ****
        drop->AddItem("Item 5");
        drop->AddItem("Item 6");
  }
  
  bool TestWindow::handleScrollPos(PG_ScrollBar* widget, long pos){
        int id = widget->GetID();
!       
        if(id == 1){
                progress->SetProgress(pos);
--- 168,177 ----
        drop->AddItem("Item 5");
        drop->AddItem("Item 6");
+ fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
  }
  
  bool TestWindow::handleScrollPos(PG_ScrollBar* widget, long pos){
        int id = widget->GetID();
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);      
        if(id == 1){
                progress->SetProgress(pos);
***************
*** 187,191 ****
  bool TestWindow::handleScrollTrack(PG_ScrollBar* widget, long pos) {
        int id = widget->GetID();
!       
        if(id == 1){
                progress->SetProgress(pos);
--- 190,194 ----
  bool TestWindow::handleScrollTrack(PG_ScrollBar* widget, long pos) {
        int id = widget->GetID();
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);      
        if(id == 1){
                progress->SetProgress(pos);
***************
*** 204,208 ****
  bool TestWindow::handleButton(PG_Button* widget) {
        static int label=0;
! 
        if(widget->GetID() == 100) {
                PG_Label* l = new PG_Label(NULL, PG_Rect(0,0,220,25), "");
--- 207,211 ----
  bool TestWindow::handleButton(PG_Button* widget) {
        static int label=0;
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        if(widget->GetID() == 100) {
                PG_Label* l = new PG_Label(NULL, PG_Rect(0,0,220,25), "");
***************
*** 342,346 ****
  
        PG_LogMSG("creating 'wnd' after %i ms", SDL_GetTicks() - start_ticks);
! 
        // create the testwindow
        TestWindow wnd(NULL, PG_Rect(100,100,500,300), "My first Testwindow");
--- 345,349 ----
  
        PG_LogMSG("creating 'wnd' after %i ms", SDL_GetTicks() - start_ticks);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        // create the testwindow
        TestWindow wnd(NULL, PG_Rect(100,100,500,300), "My first Testwindow");
***************
*** 350,359 ****
        
        PG_LogMSG("creating 'wnd1' after %i ms", SDL_GetTicks() - start_ticks);
! 
        TestWindow wnd1(NULL, PG_Rect(50,50,500,300), "My 2nd Testwindow");
        wnd1.SetTransparency(0);
        wnd1.SetName("WindowTwo");
        wnd1.SetID(101);
!       
        //PG_Draw::DrawLine(0,0, app.GetScreenWidth()-1, 
app.GetScreenHeight()-1, color,1, app.GetScreen());
        
--- 353,362 ----
        
        PG_LogMSG("creating 'wnd1' after %i ms", SDL_GetTicks() - start_ticks);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        TestWindow wnd1(NULL, PG_Rect(50,50,500,300), "My 2nd Testwindow");
        wnd1.SetTransparency(0);
        wnd1.SetName("WindowTwo");
        wnd1.SetID(101);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        //PG_Draw::DrawLine(0,0, app.GetScreenWidth()-1, 
app.GetScreenHeight()-1, color,1, app.GetScreen());
        
***************
*** 362,378 ****
        PG_RadioButton radio2(NULL, 2, PG_Rect(50,25,200,25), "RadioButton 2", 
&radio1);
        PG_RadioButton radio3(NULL, 3, PG_Rect(50,50,200,25), "RadioButton 3", 
&radio1);
!       
        PG_RadioButton radio4(NULL, 4, PG_Rect(50,90,200,25), "RadioButton 4");
        PG_RadioButton radio5(NULL, 5, PG_Rect(50,115,200,25), "RadioButton 5", 
&radio4);
        PG_RadioButton radio6(NULL, 6, PG_Rect(50,140,200,25), "RadioButton 6", 
&radio4);
! 
        PG_CheckButton check1(NULL, 7, PG_Rect(300,140,180,25), "CheckButton 
1");
        PG_PopupMenu   popmenu(NULL, 425, 140, "My Menu");
        PG_PopupMenu   submenu(NULL, 425, 140, "My SubMenu");
        PG_PopupMenu   subsubmenu(NULL, 425, 140, "");
!       
        submenu.sigMenuItemSelect.connect(slot(handle_menu_click));
        subsubmenu.sigMenuItemSelect.connect(slot(handle_menu_click));
! 
        subsubmenu.addMenuItem("Mordor", 1).
            addMenuItem("Minas Morgul", 2).
--- 365,381 ----
        PG_RadioButton radio2(NULL, 2, PG_Rect(50,25,200,25), "RadioButton 2", 
&radio1);
        PG_RadioButton radio3(NULL, 3, PG_Rect(50,50,200,25), "RadioButton 3", 
&radio1);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);      
        PG_RadioButton radio4(NULL, 4, PG_Rect(50,90,200,25), "RadioButton 4");
        PG_RadioButton radio5(NULL, 5, PG_Rect(50,115,200,25), "RadioButton 5", 
&radio4);
        PG_RadioButton radio6(NULL, 6, PG_Rect(50,140,200,25), "RadioButton 6", 
&radio4);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_CheckButton check1(NULL, 7, PG_Rect(300,140,180,25), "CheckButton 
1");
        PG_PopupMenu   popmenu(NULL, 425, 140, "My Menu");
        PG_PopupMenu   submenu(NULL, 425, 140, "My SubMenu");
        PG_PopupMenu   subsubmenu(NULL, 425, 140, "");
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        submenu.sigMenuItemSelect.connect(slot(handle_menu_click));
        subsubmenu.sigMenuItemSelect.connect(slot(handle_menu_click));
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        subsubmenu.addMenuItem("Mordor", 1).
            addMenuItem("Minas Morgul", 2).
***************
*** 383,387 ****
                addMenuItem("Hrothgar", 3).
          addMenuItem("Long ago", &subsubmenu);
!               
      popmenu.addMenuItem("Tasty", 1, slot(handle_menu_click)).
          addMenuItem("Even tastier", 2, slot(handle_menu_click)).
--- 386,390 ----
                addMenuItem("Hrothgar", 3).
          addMenuItem("Long ago", &subsubmenu);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
      popmenu.addMenuItem("Tasty", 1, slot(handle_menu_click)).
          addMenuItem("Even tastier", 2, slot(handle_menu_click)).
***************
*** 394,401 ****
      
        popmenu.disableItem(2);
!       
        PG_MenuBar menubar(NULL, PG_Rect(resx-300, 0, 300, 30));
        menubar.Add("PopMe 2", &popmenu);
! 
        PG_PopupMenu editmenu(NULL, 0 ,0, NULL);
        editmenu.addMenuItem("Cut", 1);
--- 397,404 ----
      
        popmenu.disableItem(2);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_MenuBar menubar(NULL, PG_Rect(resx-300, 0, 300, 30));
        menubar.Add("PopMe 2", &popmenu);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_PopupMenu editmenu(NULL, 0 ,0, NULL);
        editmenu.addMenuItem("Cut", 1);
***************
*** 403,407 ****
        editmenu.addMenuItem("Paste", 3);
        menubar.Add("Edit", &editmenu);
! 
        menubar.Show();
        
--- 406,410 ----
        editmenu.addMenuItem("Paste", 3);
        menubar.Add("Edit", &editmenu);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        menubar.Show();
        
***************
*** 415,419 ****
  
        check1.Show();
! 
        PG_ScrollBar scroll(NULL, 10, PG_Rect(50, 200, 300, 20), 
PG_SB_HORIZONTAL );
        scroll.Show();
--- 418,422 ----
  
        check1.Show();
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_ScrollBar scroll(NULL, 10, PG_Rect(50, 200, 300, 20), 
PG_SB_HORIZONTAL );
        scroll.Show();
***************
*** 423,447 ****
        edit.SetValidKeys("1234567890");
        edit.Show();
!       
        // our new label with the callback member
        MySliderLabel slider_label(NULL, PG_Rect(360, 250, 50,20), "5");
        slider_label.Show();
! 
        // create the slider
        PG_Slider slider(NULL, 11, PG_Rect(50, 250, 300,20), PG_SB_HORIZONTAL);
        slider.SetRange(5,20);
! 
        // connect the "MSG_SLIDE" event with "handler_slider" of slider_label 
(see macro above, just for testing)
        slider.sigSlide.connect(slot(slider_label, 
&MySliderLabel::handle_slide));
        
        slider.Show();
! 
        PG_Button popbtn(NULL, 20, PG_Rect(430, 250,100,25), "Pop me");
        popbtn.sigButtonClick.connect(slot(handle_popup), &popmenu);
        popbtn.Show();
! 
        PG_SpinnerBox spin(NULL, PG_Rect(550,250,130,25));
        spin.Show();
! 
        PG_DropDown drop(NULL, 14, PG_Rect(50, 280, 300,25));
        drop.SetIndent(5);
--- 426,450 ----
        edit.SetValidKeys("1234567890");
        edit.Show();
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        // our new label with the callback member
        MySliderLabel slider_label(NULL, PG_Rect(360, 250, 50,20), "5");
        slider_label.Show();
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        // create the slider
        PG_Slider slider(NULL, 11, PG_Rect(50, 250, 300,20), PG_SB_HORIZONTAL);
        slider.SetRange(5,20);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        // connect the "MSG_SLIDE" event with "handler_slider" of slider_label 
(see macro above, just for testing)
        slider.sigSlide.connect(slot(slider_label, 
&MySliderLabel::handle_slide));
        
        slider.Show();
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_Button popbtn(NULL, 20, PG_Rect(430, 250,100,25), "Pop me");
        popbtn.sigButtonClick.connect(slot(handle_popup), &popmenu);
        popbtn.Show();
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_SpinnerBox spin(NULL, PG_Rect(550,250,130,25));
        spin.Show();
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_DropDown drop(NULL, 14, PG_Rect(50, 280, 300,25));
        drop.SetIndent(5);
***************
*** 454,485 ****
        drop.AddItem("Item 6");
        drop.Show();
! 
        PG_Button list(NULL, BTN_ID_OK, PG_Rect(400,450,100,30), "List");
        list.sigButtonClick.connect(slot(handle_list));
        list.Show();
! 
        PG_Button quit(NULL, BTN_ID_CLOSE, PG_Rect(600,450,100,30), "Quit");
        quit.sigButtonClick.connect(slot(handle_exit), &app);
        quit.Show();
! 
        PG_Button show_wnd(NULL, BTN_ID_APPLY, PG_Rect(500,450,100,30), 
"Window");
        show_wnd.sigButtonClick.connect(slot(wnd, 
&TestWindow::handle_show_window));
!     
        show_wnd.Show();
! 
!       // show the testwindow
        wnd.Show();
!       wnd1.Show();
!       
        PG_LogMSG("app ready after %i ms", SDL_GetTicks() - start_ticks);
        app.ShowCursor(PG_CURSOR_SOFTWARE);
! 
        PG_LogMSG("testing the widget finding methods");
        PG_Widget *tmp;
!       
        tmp = PG_Application::GetWidgetByName("WindowOne");
        if (tmp)
            PG_LogMSG("'WindowOne' found by name (id %d)", tmp->GetID());
!           
        tmp = PG_Application::GetWidgetById(100);
        if (tmp)
--- 457,489 ----
        drop.AddItem("Item 6");
        drop.Show();
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_Button list(NULL, BTN_ID_OK, PG_Rect(400,450,100,30), "List");
        list.sigButtonClick.connect(slot(handle_list));
        list.Show();
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_Button quit(NULL, BTN_ID_CLOSE, PG_Rect(600,450,100,30), "Quit");
        quit.sigButtonClick.connect(slot(handle_exit), &app);
        quit.Show();
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_Button show_wnd(NULL, BTN_ID_APPLY, PG_Rect(500,450,100,30), 
"Window");
        show_wnd.sigButtonClick.connect(slot(wnd, 
&TestWindow::handle_show_window));
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        show_wnd.Show();
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
!         // show the testwindow
        wnd.Show();
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
!         wnd1.Show();
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_LogMSG("app ready after %i ms", SDL_GetTicks() - start_ticks);
        app.ShowCursor(PG_CURSOR_SOFTWARE);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_LogMSG("testing the widget finding methods");
        PG_Widget *tmp;
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        tmp = PG_Application::GetWidgetByName("WindowOne");
        if (tmp)
            PG_LogMSG("'WindowOne' found by name (id %d)", tmp->GetID());
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        tmp = PG_Application::GetWidgetById(100);
        if (tmp)
***************
*** 503,507 ****
            PG_LogMSG("sought for '1001' and found it (name '%s')",
                      tmp->GetName());
! 
  
        if(!bTestMode) {
--- 507,511 ----
            PG_LogMSG("sought for '1001' and found it (name '%s')",
                      tmp->GetName());
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
  
        if(!bTestMode) {
***************
*** 509,523 ****
            return EXIT_SUCCESS;
        }
!       
        start_ticks = SDL_GetTicks();
        int iter = 100;
!       
        for(int i=0; i<iter; i++) {
                PG_Widget::UpdateScreen();
        }
! 
        int ticks = SDL_GetTicks() - start_ticks;
        PG_LogMSG("did %i iterations in %i ms", iter, ticks);
! 
        return EXIT_SUCCESS;    
  }
--- 513,527 ----
            return EXIT_SUCCESS;
        }
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        start_ticks = SDL_GetTicks();
        int iter = 100;
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        for(int i=0; i<iter; i++) {
                PG_Widget::UpdateScreen();
        }
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        int ticks = SDL_GetTicks() - start_ticks;
        PG_LogMSG("did %i iterations in %i ms", iter, ticks);
! fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        return EXIT_SUCCESS;    
  }

Index: windowresize.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/test/windowresize.cpp,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -C2 -r1.1 -r1.1.2.1
*** windowresize.cpp    15 Apr 2002 13:31:31 -0000      1.1
--- windowresize.cpp    18 Jun 2002 22:40:39 -0000      1.1.2.1
***************
*** 3,13 ****
--- 3,29 ----
  #include "pgwindow.h"
  
+ #include "pglog.h"
+ #include "pgdraw.h"
+ 
  int main( int argc, char **argv )
  {
     PG_Application app;
+         PG_Draw::PG_DrawableSurface *screen;
  
     app.LoadTheme( "default" );
  
     app.InitScreen( 640, 480 );
+ 
+       /* Print out information about our surfaces */
+       screen = app.GetScreen();
+       PG_LogMSG("Screen is at %d bits per 
pixel",screen->getScreen()->format->BitsPerPixel);
+       if ( (screen->getScreen()->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+               PG_LogMSG("Screen is in video memory");
+       } else {
+               PG_LogMSG("Screen is in system memory");
+       }
+       if ( (screen->getScreen()->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
+               PG_LogMSG("Screen has double-buffering enabled");
+       }
  
     PG_Window a( NULL, PG_Rect( 10, 10, 100, 100 ),

Index: windowtest.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/test/windowtest.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -C2 -r1.1.1.1 -r1.1.1.1.2.1
*** windowtest.cpp      15 Apr 2002 13:22:29 -0000      1.1.1.1
--- windowtest.cpp      18 Jun 2002 22:40:39 -0000      1.1.1.1.2.1
***************
*** 45,49 ****
        app->SetEmergencyQuit(true);
        app->LoadTheme("default");
!       app->InitScreen(800,600,0,SDL_SWSURFACE);
  
        mywidget=new CMyWidget(NULL,PG_Rect(200,200,350,250));
--- 45,49 ----
        app->SetEmergencyQuit(true);
        app->LoadTheme("default");
!       app->InitScreen(800,600,16,SDL_SWSURFACE);
  
        mywidget=new CMyWidget(NULL,PG_Rect(200,200,350,250));
***************
*** 57,61 ****
                "Ok",
                PG_TA_CENTER);
!               
        PG_DropDown* drop = new PG_DropDown(msgbox, 15, PG_Rect(5, 60, 200,25));
        drop->SetIndent(5);
--- 57,61 ----
                "Ok",
                PG_TA_CENTER);
! 
        PG_DropDown* drop = new PG_DropDown(msgbox, 15, PG_Rect(5, 60, 200,25));
        drop->SetIndent(5);
***************
*** 73,77 ****
        delete app;
        
- 
        // Start the process over exactly the same
        // Crash happens here in physfs.c
--- 73,76 ----




reply via email to

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