paragui-cvs
[Top][All Lists]
Advanced

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

[paragui-cvs] CVS: paragui/test gltest.cpp,NONE,1.1.2.1 Makefile.am,1.6.


From: Teunis Peters <address@hidden>
Subject: [paragui-cvs] CVS: paragui/test gltest.cpp,NONE,1.1.2.1 Makefile.am,1.6.2.2,1.6.2.3
Date: Wed, 26 Jun 2002 04:47:54 -0400

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

Modified Files:
      Tag: devel-opengl
        Makefile.am 
Added Files:
      Tag: devel-opengl
        gltest.cpp 
Log Message:
Initial OpenGL drawable creation
added a simple OpenGL test based on 'list'
abstracted mouse management functions - solved "mouse cursor not moving" 
problem which was based on a zero-width and height mouse rectangle.


--- NEW FILE ---
/* gltest.cpp
 * ----------
 * OpenGL initial test
 */

#ifdef HAVE_OPENGL

#include "paragui.h"
#include "pgapplication.h"
#include "pgtabbar.h"
#include "pglabel.h"
#include "pgnotebook.h"
#include "pglistbox.h"
#include "pglistboxitem.h"
#include "pgcheckbutton.h"
#include "pgwindow.h"
#include "pglog.h"

#include "pggldraw.h"

bool handleListBoxItem(PG_ListBoxItem* item) {
        delete item;
        return true;
}

int main( int argc, char **argv ) {
  PG_Draw::PG_Draw* gldraw;
  gldraw = new PG_Draw::PG_GLDraw();
  PG_Draw::PG_Draw::SetDefaultDrawable(gldraw);

  PG_Application& app = PG_Application::GetInstance();
  
  app.LoadTheme("default");
  
  app.InitScreen(640, 480, 0);
  app.SetEmergencyQuit(true);
  
  PG_ListBox listbox(NULL, PG_Rect(10,10,300,100));
  listbox.sigSelectItem.connect(slot(handleListBoxItem));
  
  listbox.AddItem(new PG_ListBoxItem(25, "Item1"));
  listbox.AddItem(new PG_ListBoxItem(25, "Item2"));
  listbox.AddItem(new PG_ListBoxItem(25, "Item3"));
  listbox.AddItem(new PG_ListBoxItem(25, "Item4"));
  listbox.AddItem(new PG_ListBoxItem(25, "Item5"));
  listbox.AddItem(new PG_ListBoxItem(25, "Item6"));
  listbox.AddItem(new PG_ListBoxItem(25, "Item7"));
  listbox.AddItem(new PG_ListBoxItem(25, "Item8"));
  listbox.AddItem(new PG_ListBoxItem(25, "Item9"));
  listbox.AddItem(new PG_ListBoxItem(25, "Item10"));
  listbox.Show();
  
  
  app.Run();
  
  return 0;
}

#else /* HAVE_OPENGL */

int main(int argc, char *argv[])
{
        printf("No OpenGL support on this system\n");
        return 1;
}

#endif /* HAVE_OPENGL */

Index: Makefile.am
===================================================================
RCS file: /cvsroot/paragui/paragui/test/Makefile.am,v
retrieving revision 1.6.2.2
retrieving revision 1.6.2.3
diff -C2 -r1.6.2.2 -r1.6.2.3
*** Makefile.am 26 Jun 2002 03:25:04 -0000      1.6.2.2
--- Makefile.am 26 Jun 2002 08:47:51 -0000      1.6.2.3
***************
*** 1,5 ****
  AUTOMAKE_OPTIONS = foreign
  
! noinst_PROGRAMS = listbox tabbar animation dropdown paratest dblbuffer 
navtest windowtest layouttest windowresize
  
  listbox_SOURCES = list.cpp
--- 1,5 ----
  AUTOMAKE_OPTIONS = foreign
  
! noinst_PROGRAMS = listbox tabbar animation dropdown paratest dblbuffer 
navtest windowtest layouttest windowresize gltest
  
  listbox_SOURCES = list.cpp
***************
*** 32,35 ****
--- 32,38 ----
  layouttest_SOURCES = layouttest.cpp
  layouttest_LDADD = ../src/libparagui2.la -lfreetype
+ 
+ gltest_SOURCES = gltest.cpp
+ gltest_LDADD = ../src/libparagui2.la -lfreetype
  
  INCLUDES = \




reply via email to

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