wince port, glcanvas position not changing
Selçuk Cihan
selcukcihan at gmail.com
Thu Feb 7 06:39:54 PST 2008
Hello, since wxglcanvas for wince is incomplete, i am writing two
custom classes to replace wxglcanvas and wxglcontext. I am linking to
Vincent's Opengl ES library ( http://sourceforge.net/projects/ogl-es ,
it also includes EGL library). I can render some stuff on my PDA, but
unfortunately when i instantiate a class which inherits from
wxglcanvas, the glcanvas position is not changing at all, it always
shows at the top of the screen. Here is a screenshot from the pda
emulator
http://img512.imageshack.us/img512/2577/glcanvassamplevs2.jpg
I am not sure if pasting code is welcome, i am not very familiar with
mailing lists, nevertheless following code creates the frame and
canvas. i am using a sizer and a panel, so maybe i am making a mistake
in that code piece.
//code begins
wxString str = wxT("wxWidgets OpenGL Cube Sample");
wxPoint point(0,80);
wxSize size(200,200);
MyFrame *frame = new MyFrame(NULL, str, point, wxSize(-1, -1));
wxMenu *winMenu = new wxMenu;
winMenu->Append(wxID_EXIT, _T("&Close"));
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(winMenu, _T("&Window"));
frame->SetMenuBar(menuBar);
wxPanel *panel=new wxPanel(frame,-1);
wxBoxSizer *sizer=new wxBoxSizer(wxVERTICAL);
sizer->Add( new wxStaticLine(panel, -1), 0, wxGROW );
wxButton *btn=new wxButton(panel,-1,_T("pufff"));
sizer->Add(btn);
frame->m_canvas = new TestGLCanvas(panel, wxID_ANY, point, size);
sizer->Add(frame->m_canvas,1,wxEXPAND|wxALL,10);
panel->SetSizer( sizer );
panel->SetAutoLayout( TRUE );
frame->Show(true);
//code ends
I really need ideas about where to search for the cause of the
misbehaviour. Following is the behaviour of the very same code on
winxp http://img152.imageshack.us/img152/9923/glcanvaspcsampleup5.jpg
If you say that the above code should position the canvas correctly,
then i will continue searching for the error in my custom wxglcanvas
and context implementations.
Have a nice day.
More information about the wx-users
mailing list