Yes, including gl.h is (almost) a must for OGL programs. But yu can include it later, not at the very beginning.
Take a look at yourwxdir/samples/opengl/pyramid/pyramid.cpp In its first lines you find how this issue is worked out.
Search found 828 matches
- Mon Apr 01, 2024 12:11 pm
- Forum: Compiler / Linking / IDE Related
- Topic: Using glbinding with wxWidgets >= 3.2
- Replies: 1
- Views: 4435
- Fri Feb 16, 2024 6:36 pm
- Forum: General Development
- Topic: wxBombs bug
- Replies: 15
- Views: 6871
Re: wxBombs bug
Thank you for telling us the issue you found and its fix. But this is not the right place to notify the developers. Consider opening a "Pull Request" at GitHub, or for such a small fix subscribe and post a message to the developers mailing list. See https://www.wxwidgets.org/develop/how-to...
- Fri Feb 16, 2024 6:29 pm
- Forum: Platform Related Issues
- Topic: cannot initilize opengl and glew
- Replies: 4
- Views: 3999
Re: cannot initilize opengl and glew
@doublemax: A minor detail: While you can create the context any where, in Linux what you can NOT do is calling wxGLContext::SetCurrent() before the window is realized (which is close to 'shown on screen') @primator77: As @doublemax suggested, see opengl/pyramid sample for some guide. And also https...
- Wed Jan 10, 2024 8:59 pm
- Forum: C++ Development
- Topic: integrate openGL canvas in a wxFrame
- Replies: 3
- Views: 11834
Re: integrate openGL canvas in a wxFrame
I know nothing about vtk. But it seems to me your issue comes from vtk-wxWidgets integration, specially about getting the "handle" of the native window (which is different from the wxWidgets window) Perhaps these posts I've found may help you: https://forums.wxwidgets.org/viewtopic.php?t=4...
- Fri Dec 29, 2023 8:34 pm
- Forum: Platform Related Issues
- Topic: OpenGl context binds correctly on Windows, but not ubuntu
- Replies: 3
- Views: 5803
Re: OpenGl context binds correctly on Windows, but not ubuntu
All gl calls must be executed under wxGlCanvas::render() Err... no. You can call gl-XXX wherever you like. Only that you must call gl-funcs from the thread that you called wxGLContext::SetCurrent or use a shared context. While you may use other threads my advice is to call all gl-stuff from the mai...
- Tue Dec 26, 2023 7:12 pm
- Forum: C++ Development
- Topic: FloatingPointValidator and Weird negative number
- Replies: 3
- Views: 4065
Re: FloatingPointValidator and Weird negative number
Any format, any number of digits:
https://sourceforge.net/projects/wxcode ... Validator/
https://sourceforge.net/projects/wxcode ... Validator/
- Mon Dec 11, 2023 8:05 pm
- Forum: C++ Development
- Topic: What occurs when too many wxBitmap/wxGraphicsBitmap objects are drawn?
- Replies: 10
- Views: 28025
Re: What occurs when too many wxBitmap/wxGraphicsBitmap objects are drawn?
If the usage of those bitmaps is to be sent to the GPU, then you can use glTexSubImage2D to update an existing gl-texture by sub-regions.
Thus, you can clear-and-reuse an only wxBitmap. Same for the wxImage likely used as the "data" parameter of glTextxxx commands.
Thus, you can clear-and-reuse an only wxBitmap. Same for the wxImage likely used as the "data" parameter of glTextxxx commands.
- Fri Dec 08, 2023 6:29 pm
- Forum: Compiler / Linking / IDE Related
- Topic: MinGW linking issue
- Replies: 17
- Views: 45723
Re: MinGW linking issue
@doublemax, MinGW only supports 32-bit, and it's slowly becoming dead. But MinGW-64 supports both 32/64 bits. The proper flags are "-m32" and "-m64" @nore: You need to compile both wx and your app in the same 32/64 mode. Be aware to tell CMake where to find the proper ".a&qu...
- Fri Nov 24, 2023 1:35 am
- Forum: C++ Development
- Topic: Mysterious bug involving OpenGL and wxMessageBox()
- Replies: 11
- Views: 6575
Re: Mysterious bug involving OpenGL and wxMessageBox()
Your overall design is correct. Perhaps it needs some details. *) Remember to call SetCurrent for the context before any gl-command. *) Using a Debug-Context must be asked by wxContextAttrs. If the GPU driver can't provide it the wxGLContext::IsOk() should return false, except in MacOS, which comple...
- Sun Nov 19, 2023 7:45 pm
- Forum: C++ Development
- Topic: Image rotation
- Replies: 3
- Views: 1724
Re: Image rotation
There's some mess in your concept of a rotation. Don't care, it's usual at first. The first thing to take care is the coordinates system. Mouse events give you client coords, while wxImage works with its "local" coords. When you call wxImage::Rotate(angle, centre) you must pass angle in ra...
- Sat Nov 11, 2023 7:21 pm
- Forum: Compiler / Linking / IDE Related
- Topic: Checking if wxWidgets was compiled with EGL or GLX support?
- Replies: 4
- Views: 4380
Re: Checking if wxWidgets was compiled with EGL or GLX support?
As stahta01 pointed, wxUSE_GLCANVAS_EGL is a good way. Typical first lines in all wx-apps are // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifndef WX_PRECOMP #include "wx/wx.h" #endif And this is enough to get the wxUSE_GLCANV...
- Fri Oct 20, 2023 8:01 pm
- Forum: C++ Development
- Topic: Display large images
- Replies: 5
- Views: 1191
Re: Display large images
32kx32k RGB image is about 3 GB of data. If user continuosly use zoom/pane it's a lot of work for the CPU on resizing the image. I'd consider the usage of OpenGL (or DirectX). The idea is to transfer the raw image to the GPU (or "map" the buffer to the raw camera buffer). Use an orthogonal...
- Tue Oct 10, 2023 5:21 pm
- Forum: C++ Development
- Topic: wxwidget as external window
- Replies: 3
- Views: 2206
Re: wxwidget as external window
wxWidgets and SDL? Why? Well, everything that SDL does can also be made with wxWidgets. But wx is much more featured, SDL is "media-oriented". Granted, some tasks seem easier with SDL. Because both provide window creation, event processing and other OS' services, you must tell which one (w...
- Fri Oct 06, 2023 6:58 pm
- Forum: Platform Related Issues
- Topic: wxWidgets make text Bold on Raspberry Pi 4
- Replies: 3
- Views: 2926
Re: wxWidgets make text Bold on Raspberry Pi 4
I know nothing about RPI, so this is a blind-shot: What if you first create a default wxStaticText: textHeadline = new wxStaticText(); and then set the rest of parameters? textHeadline->SetFont(font); textHeadline->Create(panel, wxID_ANY, "test", wxPoint(100, 190), wxSize(600, 60), wxALIGN...
- Fri Oct 06, 2023 6:44 pm
- Forum: C++ Development
- Topic: synchronisation method between parent frame and wxOpenGL canvas code
- Replies: 1
- Views: 1902
Re: synchronisation method between parent frame and wxOpenGL canvas code
in GLFW, I would synchronously call glfwCreateWindow(..) and setContext current in main thread without any issues. Yeah. It's GTK the culprit (GLFW does direct X11/Wayland calls). Some day I have to dig GTK code to see it this can be improved. I need a 'synchronisation join point' Well, the only ca...