Need help using OpenGL

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
motorhead9999
Earned a small fee
Earned a small fee
Posts: 12
Joined: Wed Jan 04, 2006 3:13 am
Location: Orlando, Florida
Contact:

Need help using OpenGL

Post by motorhead9999 » Wed Jan 04, 2006 11:45 pm

Hey everyone,
I'm fairly new to wxwidgets, and i'm having some problems. I'm just trying to get a general OpenGL event to happen, but I'm not having any luck. I get the window for the wxGLCanvas object to show up (the sunken window effect proves that) but nothing draws on the canvas. Here's my code. I'd appreciate any help I could get on the matter. My environment is set up right, as I don't get any errors or linking problems, and I'm able to run the samples that come with it. Also, if anyone cares to make some general comments on the coding/app, please feel free to. This is my first time really using wxWidgets. Liking the experience so far.
Thanks in advance for any help!

Code: Select all

#include "wx/wx.h"
#include "wx/textctrl.h"
#include "wx/statbox.h"
#include "wx/radiobox.h"
#include "wx/spinctrl.h"
//#include "GL/glut.h"
#include "wx/glcanvas.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <GL/gl.h>
#include <gl/glu.h>
enum
{
	ID_POSITIONNUM=10006
};

class MyApp : public wxApp
{
	public:
		virtual bool OnInit();
};

class SphinxAnimationClass : public wxPanel
{
	public:
		SphinxAnimationClass(wxFrame *frame, int x, int y, int w, int h);
		//void OnPaint(wxPaintEvent& event);
	private:
		DECLARE_EVENT_TABLE()
};

class ButtonPanelClass : public wxPanel
{
	public:
		ButtonPanelClass(wxFrame *frame, int x, int y, int w, int h);
	  void OnRadio(wxCommandEvent& event);
	  void OnCompute(wxCommandEvent& event);
	  void OnReset(wxCommandEvent& event);

	private:
		DECLARE_EVENT_TABLE()
};


class MyFrame : public wxFrame
{
	public:
		MyFrame(const wxString& title, int x, int y, int w, int h);
		void OnQuit(wxCommandEvent& event);
		void OnAbout(wxCommandEvent& event);

	private:
		DECLARE_EVENT_TABLE()
};

class MyPanel: public wxPanel
{
public:
      MyPanel(wxFrame *frame, int x, int y, int w, int h);
private:
	DECLARE_EVENT_TABLE()
};


class MyText : public wxTextCtrl
{
	public:
		MyText(wxPanel *panel, int x, int y, int w, int h);
	private:
};



DECLARE_APP(MyApp)
IMPLEMENT_APP(MyApp)

bool MyApp::OnInit()
{
	MyFrame *SphinxMainFrame =  new MyFrame(wxT("SPHINXPC"),0,0,1200,700);
	
	SphinxAnimationClass *AnimationPanel = new SphinxAnimationClass(SphinxMainFrame,0,0,300,300);
	MyPanel *PositionSynthesisGLPanel = new MyPanel(SphinxMainFrame,0,300,300,300);

	MyPanel *GuideMapPanel = new MyPanel(SphinxMainFrame,850,0,400,350);

	MyPanel *Position1Panel= new MyPanel(SphinxMainFrame,300,0,275,175);
	wxStaticBox *Pos1Box = new wxStaticBox(Position1Panel,wxID_STATIC,wxT("Position 1"),wxPoint(5,0),wxSize(250,170));
	wxTextCtrl *P1a11 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,20),wxSize(50,20));
	wxTextCtrl *P1a12 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,20),wxSize(50,20));
	wxTextCtrl *P1a13 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,20),wxSize(50,20));
	wxTextCtrl *P1a14 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,20),wxSize(50,20));
	wxTextCtrl *P1a21 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,55),wxSize(50,20));
	wxTextCtrl *P1a22 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,55),wxSize(50,20));
	wxTextCtrl *P1a23 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,55),wxSize(50,20));
	wxTextCtrl *P1a24 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,55),wxSize(50,20));
	wxTextCtrl *P1a31 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,90),wxSize(50,20));
	wxTextCtrl *P1a32 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,90),wxSize(50,20));
	wxTextCtrl *P1a33 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,90),wxSize(50,20));
	wxTextCtrl *P1a34 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,90),wxSize(50,20));
	wxTextCtrl *P1a41 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,125),wxSize(50,20));
	wxTextCtrl *P1a42 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,125),wxSize(50,20));
	wxTextCtrl *P1a43 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,125),wxSize(50,20));
	wxTextCtrl *P1a44 = new wxTextCtrl(Position1Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,125),wxSize(50,20));

	MyPanel *Position2Panel= new MyPanel(SphinxMainFrame,575,0,275,175);
	wxStaticBox *Pos2Box = new wxStaticBox(Position2Panel,wxID_STATIC,wxT("Position 2"),wxPoint(5,0),wxSize(250,170));
	wxTextCtrl *P2a11 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,20),wxSize(50,20));
	wxTextCtrl *P2a12 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,20),wxSize(50,20));
	wxTextCtrl *P2a13 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,20),wxSize(50,20));
	wxTextCtrl *P2a14 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,20),wxSize(50,20));
	wxTextCtrl *P2a21 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,55),wxSize(50,20));
	wxTextCtrl *P2a22 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,55),wxSize(50,20));
	wxTextCtrl *P2a23 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,55),wxSize(50,20));
	wxTextCtrl *P2a24 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,55),wxSize(50,20));
	wxTextCtrl *P2a31 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,90),wxSize(50,20));
	wxTextCtrl *P2a32 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,90),wxSize(50,20));
	wxTextCtrl *P2a33 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,90),wxSize(50,20));
	wxTextCtrl *P2a34 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,90),wxSize(50,20));
	wxTextCtrl *P2a41 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,125),wxSize(50,20));
	wxTextCtrl *P2a42 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,125),wxSize(50,20));
	wxTextCtrl *P2a43 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,125),wxSize(50,20));
	wxTextCtrl *P2a44 = new wxTextCtrl(Position2Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,125),wxSize(50,20));
	
	MyPanel *Position3Panel= new MyPanel(SphinxMainFrame,300,175,275,175);
	wxStaticBox *Pos3Box = new wxStaticBox(Position3Panel,wxID_STATIC,wxT("Position 3"),wxPoint(5,0),wxSize(250,170));
	wxTextCtrl *P3a11 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,20),wxSize(50,20));
	wxTextCtrl *P3a12 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,20),wxSize(50,20));
	wxTextCtrl *P3a13 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,20),wxSize(50,20));
	wxTextCtrl *P3a14 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,20),wxSize(50,20));
	wxTextCtrl *P3a21 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,55),wxSize(50,20));
	wxTextCtrl *P3a22 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,55),wxSize(50,20));
	wxTextCtrl *P3a23 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,55),wxSize(50,20));
	wxTextCtrl *P3a24 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,55),wxSize(50,20));
	wxTextCtrl *P3a31 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,90),wxSize(50,20));
	wxTextCtrl *P3a32 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,90),wxSize(50,20));
	wxTextCtrl *P3a33 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,90),wxSize(50,20));
	wxTextCtrl *P3a34 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,90),wxSize(50,20));
	wxTextCtrl *P3a41 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,125),wxSize(50,20));
	wxTextCtrl *P3a42 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,125),wxSize(50,20));
	wxTextCtrl *P3a43 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,125),wxSize(50,20));
	wxTextCtrl *P3a44 = new wxTextCtrl(Position3Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,125),wxSize(50,20));

 	MyPanel *Position4Panel= new MyPanel(SphinxMainFrame,575,175,275,175);
	wxStaticBox *Pos4Box = new wxStaticBox(Position4Panel,wxID_STATIC,wxT("Position 4"),wxPoint(5,0),wxSize(250,170));
	wxTextCtrl *P4a11 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,20),wxSize(50,20));
	wxTextCtrl *P4a12 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,20),wxSize(50,20));
	wxTextCtrl *P4a13 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,20),wxSize(50,20));
	wxTextCtrl *P4a14 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,20),wxSize(50,20));
	wxTextCtrl *P4a21 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,55),wxSize(50,20));
	wxTextCtrl *P4a22 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,55),wxSize(50,20));
	wxTextCtrl *P4a23 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,55),wxSize(50,20));
	wxTextCtrl *P4a24 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,55),wxSize(50,20));
	wxTextCtrl *P4a31 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,90),wxSize(50,20));
	wxTextCtrl *P4a32 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,90),wxSize(50,20));
	wxTextCtrl *P4a33 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,90),wxSize(50,20));
	wxTextCtrl *P4a34 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,90),wxSize(50,20));
	wxTextCtrl *P4a41 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(0+10,125),wxSize(50,20));
	wxTextCtrl *P4a42 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(60+10,125),wxSize(50,20));
	wxTextCtrl *P4a43 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(120+10,125),wxSize(50,20));
	wxTextCtrl *P4a44 = new wxTextCtrl(Position4Panel,wxID_ANY,wxEmptyString,wxPoint(180+10,125),wxSize(50,20));


	ButtonPanelClass *ButtonsPanel = new ButtonPanelClass(SphinxMainFrame,300,350,300,250);
	wxButton* EnterButton = new wxButton(ButtonsPanel, wxID_OK, wxT("Compute Mechanism"), wxPoint(5,5),wxSize(125,25));	
	wxButton* ResetButton = new wxButton(ButtonsPanel, wxID_RESET,wxT("Reset Windows"), wxPoint(5,35),wxSize(125,25));
	
	wxArrayString ButtonsRadioStrings;
	ButtonsRadioStrings.Add(wxT("3 Positions"));
	ButtonsRadioStrings.Add(wxT("4 Positions"));
	wxRadioBox* ButtonsRadio = new wxRadioBox(ButtonsPanel,ID_POSITIONNUM,wxT("Sphinx Mode: "),wxPoint(140,5),wxDefaultSize,ButtonsRadioStrings,1,wxRA_SPECIFY_COLS);
	
	wxGLCanvas* MyGLCanvas = new wxGLCanvas(AnimationPanel , -1, wxDefaultPosition, wxSize(280,280), wxSUNKEN_BORDER);
	wxGLCanvas* PositionSynthesis = new wxGLCanvas(PositionSynthesisGLPanel , -1, wxDefaultPosition, wxSize(280,280), wxSUNKEN_BORDER);

//	

	
	MyGLCanvas->SetCurrent();


    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glFrustum(-0.5f, 0.5f, -0.5f, 0.5f, 1.0f, 3.0f);
    glMatrixMode(GL_MODELVIEW);

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
        glBegin(GL_QUADS);
        glNormal3f( 0.0f, 0.0f, 1.0f);
        glVertex3f( 0.5f, 0.5f, 0.5f); glVertex3f(-0.5f, 0.5f, 0.5f);
        glVertex3f(-0.5f,-0.5f, 0.5f); glVertex3f( 0.5f,-0.5f, 0.5f);

        glNormal3f( 0.0f, 0.0f,-1.0f);
        glVertex3f(-0.5f,-0.5f,-0.5f); glVertex3f(-0.5f, 0.5f,-0.5f);
        glVertex3f( 0.5f, 0.5f,-0.5f); glVertex3f( 0.5f,-0.5f,-0.5f);

        glNormal3f( 0.0f, 1.0f, 0.0f);
        glVertex3f( 0.5f, 0.5f, 0.5f); glVertex3f( 0.5f, 0.5f,-0.5f);
        glVertex3f(-0.5f, 0.5f,-0.5f); glVertex3f(-0.5f, 0.5f, 0.5f);

        glNormal3f( 0.0f,-1.0f, 0.0f);
        glVertex3f(-0.5f,-0.5f,-0.5f); glVertex3f( 0.5f,-0.5f,-0.5f);
        glVertex3f( 0.5f,-0.5f, 0.5f); glVertex3f(-0.5f,-0.5f, 0.5f);

        glNormal3f( 1.0f, 0.0f, 0.0f);
        glVertex3f( 0.5f, 0.5f, 0.5f); glVertex3f( 0.5f,-0.5f, 0.5f);
        glVertex3f( 0.5f,-0.5f,-0.5f); glVertex3f( 0.5f, 0.5f,-0.5f);

        glNormal3f(-1.0f, 0.0f, 0.0f);
        glVertex3f(-0.5f,-0.5f,-0.5f); glVertex3f(-0.5f,-0.5f, 0.5f);
        glVertex3f(-0.5f, 0.5f, 0.5f); glVertex3f(-0.5f, 0.5f,-0.5f);
        glEnd();
    glFlush();
    MyGLCanvas->SwapBuffers();

  //MyGLCanvas->SwapBuffers();
 
	SphinxMainFrame->Show(true);
	return true;
}



BEGIN_EVENT_TABLE(MyFrame,wxFrame)
EVT_MENU(wxID_ABOUT, MyFrame::OnAbout)
EVT_MENU(wxID_EXIT, MyFrame::OnQuit)
END_EVENT_TABLE()

BEGIN_EVENT_TABLE(MyPanel,wxPanel)
END_EVENT_TABLE()

BEGIN_EVENT_TABLE(SphinxAnimationClass,wxPanel)
END_EVENT_TABLE()



BEGIN_EVENT_TABLE(ButtonPanelClass,wxPanel)
EVT_RADIOBOX(ID_POSITIONNUM,ButtonPanelClass::OnRadio)
EVT_BUTTON(wxID_OK,ButtonPanelClass::OnCompute)
EVT_BUTTON(wxID_RESET,ButtonPanelClass::OnReset)
END_EVENT_TABLE()








void ButtonPanelClass::OnRadio(wxCommandEvent &event)
{
	wxString dummymsg;
	dummymsg.Printf(wxT("This is a placeholder test messsage"),wxVERSION_STRING);
	wxMessageBox(dummymsg,wxT("About SphinxPC"),wxOK |wxICON_INFORMATION, this);
}

void ButtonPanelClass::OnCompute(wxCommandEvent &event)
{
	wxString dummymsg;
	dummymsg.Printf(wxT("This is a placeholder test messsage for compute"),wxVERSION_STRING);
	wxMessageBox(dummymsg,wxT("About SphinxPC"),wxOK |wxICON_INFORMATION, this);
}

void ButtonPanelClass::OnReset(wxCommandEvent &event)
{
	wxString dummymsg;
	dummymsg.Printf(wxT("This is a placeholder test messsage for reset"),wxVERSION_STRING);
	wxMessageBox(dummymsg,wxT("About SphinxPC"),wxOK |wxICON_INFORMATION, this);
}

void MyFrame::OnAbout(wxCommandEvent& event)
{
	wxString SphinxAboutmsg;
	SphinxAboutmsg.Printf(wxT("SphinxPC Version 0.0\nFlorida Institute of Technology"),wxVERSION_STRING);
	wxMessageBox(SphinxAboutmsg,wxT("About SphinxPC"),wxOK |wxICON_INFORMATION, this);
}

void MyFrame::OnQuit(wxCommandEvent& event)
{
	Close();
}

#include "mondrian.xpm"
MyFrame::MyFrame(const wxString& title, int x,int y,int w,int h): wxFrame(NULL, wxID_ANY, title, wxPoint(x,y),wxSize(w,h))
{
	SetIcon(wxIcon(mondrian_xpm));
	wxMenu *fileMenu = new wxMenu;

	fileMenu->Append(wxID_NEW,wxT("&New Mechanism\tAlt-N"),wxT("Create a New Mechanism"));
	fileMenu->Append(wxID_OPEN,wxT("&Open Mechanism\tAlt-O"),wxT("Opens an Existing Mechansim"));
	fileMenu->Append(wxID_SAVE,wxT("&Save\tAlt-S"),wxT("Saves Current Mechanism"));
	fileMenu->Append(wxID_SAVEAS,wxT("S&ave as\tAlt-A"),wxT("Saves Current Mechanism as"));
	fileMenu->Append(wxID_EXIT,wxT("E&xit\tAlt-X"),wxT("Exit Sphinx")); 
	
	wxMenu *exportMenu = new wxMenu;
	exportMenu->Append(wxID_ANY,wxT("&Export\tAlt-E"),wxT("Export Mechanism"));
	exportMenu->Append(wxID_ANY,wxT("SphinxCAM &PRO-E\tAlt-P"),wxT("Generate SphinxCAM Pro-E Files"));

	wxMenu *helpMenu = new wxMenu;
	helpMenu->Append(wxID_ABOUT,wxT("&About...\tF1"),wxT("Show about dialog"));

	wxMenuBar *menuBar =new wxMenuBar();
	
	menuBar->Append(fileMenu, wxT("&File"));
	menuBar->Append(exportMenu,wxT("Ex&port"));
	menuBar->Append(helpMenu, wxT("&Help"));

	SetMenuBar(menuBar);

	CreateStatusBar(2);
	SetStatusText(wxT("Welcome to SphinxPC!"));
}



MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
       : wxPanel( frame, wxID_ANY, wxPoint(x, y), wxSize(w, h) )
{
}

SphinxAnimationClass::SphinxAnimationClass( wxFrame *frame, int x, int y, int w, int h )
       : wxPanel( frame, wxID_ANY, wxPoint(x, y), wxSize(w, h) )
{
}

ButtonPanelClass::ButtonPanelClass( wxFrame *frame, int x, int y, int w, int h )
       : wxPanel( frame, wxID_ANY, wxPoint(x, y), wxSize(w, h) )
{
}

sethjackson
Super wx Problem Solver
Super wx Problem Solver
Posts: 396
Joined: Wed Oct 05, 2005 1:19 am

Post by sethjackson » Mon Jan 09, 2006 1:06 am

You need to derive from wxGLCanvas and provide an OnPaint event.....

Why are all thos wxTextCtrls in there? :shock:

motorhead9999
Earned a small fee
Earned a small fee
Posts: 12
Joined: Wed Jan 04, 2006 3:13 am
Location: Orlando, Florida
Contact:

Post by motorhead9999 » Mon Jan 09, 2006 3:36 pm

Thanks for writing back.
First off, all those text controls are for user inputs. My program involves them inputting the elements of up to 4 4x4 matrices. So basically you have a bunch of grids of text inputs. Is there a simpler way of doing that than I have?

Also, for the wxGLCanvas issue, are you saying I should derive a new class for wxGLCanvas stuff, like i did with the frames and stuff?

Again, thansk for the help

ssigala
Earned some good credits
Earned some good credits
Posts: 109
Joined: Fri Sep 03, 2004 9:30 am
Location: Brescia, Italy

Post by ssigala » Mon Jan 09, 2006 4:25 pm

motorhead9999 wrote:Thanks for writing back.
First off, all those text controls are for user inputs. My program involves them inputting the elements of up to 4 4x4 matrices. So basically you have a bunch of grids of text inputs. Is there a simpler way of doing that than I have?
I think that your job will be easier using wxGrid, maybe also deriving from wxGridTableBase, for managing the data.
Also, for the wxGLCanvas issue, are you saying I should derive a new class for wxGLCanvas stuff, like i did with the frames and stuff?
Please consult the sample "samples/opengl/cube" witch is very simple: basically you have to derive from wxGLCanvas and implement the OnPaint and OnSize events, and also initialize OpenGL on the first repaint.
Sandro Sigala - Kynosoft, Brescia

sethjackson
Super wx Problem Solver
Super wx Problem Solver
Posts: 396
Joined: Wed Oct 05, 2005 1:19 am

Post by sethjackson » Mon Jan 09, 2006 5:03 pm

motorhead9999 wrote: Also, for the wxGLCanvas issue, are you saying I should derive a new class for wxGLCanvas stuff, like i did with the frames and stuff?
Again, thansk for the help
Yes it makes everything neater/easier. :)

Post Reply