Maybe I should have done that from the start? When I search google and docs.wxwidgets.org i dont see any wxGLPanel documentation? Do you know how I would do this?
Drawing with opengl seems to be pretty straight foward using glVertex2f
https://www.ntu.edu.sg/home/ehchua/prog ... ction.html
help drawing this on device context
-
- Earned some good credits
- Posts: 125
- Joined: Wed Oct 28, 2015 9:48 pm
Re: help drawing this on device context
That depends on which drawing operations you need. E.g. there is no function to draw text in OpenGL. So you need to find some code that does this for you.Drawing with opengl seems to be pretty straight foward using glVertex2f
I just remembered this:
viewtopic.php?p=96261
It's pretty old, but maybe it still works.
Use the source, Luke!
-
- Earned some good credits
- Posts: 125
- Joined: Wed Oct 28, 2015 9:48 pm
Re: help drawing this on device context
So I was able to get AA to work properly but not on this code..
code from other thread
my code using wxMemoryDC (drawing to a buffer/wxbitmap and then rendering it to screen)
Can someone please tell me why this causes a core dump? Casting problem?
code from other thread
Code: Select all
wxPaintDC pdc(this);
#if wxUSE_GRAPHICS_CONTEXT
wxGCDC gdc( pdc ) ;
wxDC &dc = m_useContext ? (wxDC&) gdc : (wxDC&) pdc ;
#else
wxDC &dc = pdc ;
#endif
PrepareDC(dc);
my code using wxMemoryDC (drawing to a buffer/wxbitmap and then rendering it to screen)
Code: Select all
wxMemoryDC pdc;
bool m_useContext = true;
wxGCDC gdc( pdc ) ; // this gives a core dump
wxMemoryDC &dc = m_useContext ? (wxMemoryDC&) gdc : (wxMemoryDC&) pdc ;
Re: help drawing this on device context
Code: Select all
wxMemoryDC pdc;
bool m_useContext = true;
// wxMemoryDC pdc is not initialized with a bitmap at this point
wxGCDC gdc( pdc ) ; // this gives a core dump
// this should be wxDC &dc like in the sample. gdc is not a wxMemoryDC
wxMemoryDC &dc = m_useContext ? (wxMemoryDC&) gdc : (wxMemoryDC&) pdc ;
Use the source, Luke!