Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 219951 Details for
Bug 305475
media-gfx/hugin-2009.2.0 crashes immediately after splash
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Example of WxGLCanvas usage
glcanvastest.cpp (text/plain), 2.48 KB, created by
Jessica Leigh
on 2010-02-17 01:57:43 UTC
(
hide
)
Description:
Example of WxGLCanvas usage
Filename:
MIME Type:
Creator:
Jessica Leigh
Created:
2010-02-17 01:57:43 UTC
Size:
2.48 KB
patch
obsolete
>// NOTE: To run, it is recommended not to be in Compiz or Beryl, they have shown some instability. > >#include "wx/wx.h" >#include "wx/glcanvas.h" > >#ifdef __WXMAC__ >#include "GLUT/glut.h" >#else >#include "GL/glut.h" >#endif > >#ifndef WIN32 >#include <unistd.h> // FIXME: ¿This work/necessary in Windows? > //Not necessary, but if it was, it needs to be replaced by process.h AND io.h >#endif > >class wxGLCanvasSubClass: public wxGLCanvas { > void Render(); >public: > wxGLCanvasSubClass(wxFrame* parent); > void Paintit(wxPaintEvent& event); >protected: > DECLARE_EVENT_TABLE() >}; > >BEGIN_EVENT_TABLE(wxGLCanvasSubClass, wxGLCanvas) > EVT_PAINT (wxGLCanvasSubClass::Paintit) >END_EVENT_TABLE() > >wxGLCanvasSubClass::wxGLCanvasSubClass(wxFrame *parent) >:wxGLCanvas(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, wxT("GLCanvas")){ > int argc = 1; > char* argv[1] = { wxString((wxTheApp->argv)[0]).char_str() }; > >/* >NOTE: this example uses GLUT in order to have a free teapot model >to display, to show 3D capabilities. GLUT, however, seems to cause problems >on some systems. If you meet problems, first try commenting out glutInit(), >then try comeenting out all glut code >*/ > glutInit(&argc, argv); >} > > >void wxGLCanvasSubClass::Paintit(wxPaintEvent& WXUNUSED(event)){ > Render(); >} > >void wxGLCanvasSubClass::Render() >{ > SetCurrent(); > wxPaintDC(this); > glClearColor(0.0, 0.0, 0.0, 0.0); > glClear(GL_COLOR_BUFFER_BIT); > glViewport(0, 0, (GLint)GetSize().x, (GLint)GetSize().y); > > glBegin(GL_POLYGON); > glColor3f(1.0, 1.0, 1.0); > glVertex2f(-0.5, -0.5); > glVertex2f(-0.5, 0.5); > glVertex2f(0.5, 0.5); > glVertex2f(0.5, -0.5); > glColor3f(0.4, 0.5, 0.4); > glVertex2f(0.0, -0.8); > glEnd(); > > glBegin(GL_POLYGON); > glColor3f(1.0, 0.0, 0.0); > glVertex2f(0.1, 0.1); > glVertex2f(-0.1, 0.1); > glVertex2f(-0.1, -0.1); > glVertex2f(0.1, -0.1); > glEnd(); > >// using a little of glut > glColor4f(0,0,1,1); > glutWireTeapot(0.4); > > glLoadIdentity(); > glColor4f(2,0,1,1); > glutWireTeapot(0.6); >// done using glut > > glFlush(); > SwapBuffers(); >} > >class MyApp: public wxApp >{ > virtual bool OnInit(); > wxGLCanvas * MyGLCanvas; >}; > > >IMPLEMENT_APP(MyApp) > > >bool MyApp::OnInit() >{ > wxFrame *frame = new wxFrame((wxFrame *)NULL, -1, wxT("Hello GL World"), wxPoint(50,50), wxSize(200,200)); > new wxGLCanvasSubClass(frame); > > frame->Show(TRUE); > return TRUE; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 305475
: 219951 |
219955