error running first example (chapter 3 triangle) - Printable Version +- Forums (http://www.scratchpadgames.net/forums) +-- Forum: Main Forums (http://www.scratchpadgames.net/forums/forumdisplay.php?fid=1) +--- Forum: Help my code won't work?? (http://www.scratchpadgames.net/forums/forumdisplay.php?fid=22) +--- Thread: error running first example (chapter 3 triangle) (/showthread.php?tid=65) Pages:
1
2
|
RE: error running first example (chapter 3 triangle) - Brian Beuken - 06-07-2018 Hi DieSkaarj nice to see you here. Ok well the 1st and most obvious thing is that you have an error on line 6 of your vertex shader, its as simple as that, it might be a missing ; on line 5, or a spelling error/upper lower case mistake on line 6 itself but for sure thats an error, which stops the shaders compiling and prevents you moving forward can you double check? if you can't see it feel free to zip up the code and send it to me I'll check it out. I've never used Geany but VisualGDB is actually using g++ so as long as you are using the right include paths it should work ok, if a little slow. where is it finding this int32_t success = 0; line? RE: error running first example (chapter 3 triangle) - Brian Beuken - 06-08-2018 (06-07-2018, 05:29 PM)DieSkaarj Wrote: Hi I'm also experiencing this problem except that changing the GL driver to Legacy gives me a new error: I suspect the in32_t error is due to warning levels, if Geany is providing some g++ defaults and you are treating warnings as errors, then the fact success is not used will indeed throw an error. Just comment it out, its a bit of a throwback line of code and not really needed. I don't really like using "treat warnings as errors" even though in a professional settings, its generally good practice, however since we're using libs from 3rd parties we may not be able to fix all warnings, so try to find the option to set them to normal levels of 0-3 Let me know how you get on? RE: error running first example (chapter 3 triangle) - DieSkaarj - 06-08-2018 (06-08-2018, 12:45 AM)Brian Beuken Wrote:(06-07-2018, 05:29 PM)DieSkaarj Wrote: Hi I'm also experiencing this problem except that changing the GL driver to Legacy gives me a new error: Thanks Brian. I've got it working! So I didn't realize that the vertex shader was declared in this file and I got baffled looking at line 6 which, in my file, is: include <assert.h>. This led me to think that the vertex shader was external. The only other experience I have with OpenGL shaders at this point is messing around with them in emulators. One typo-correction later and after much trial and error (found on line 2 of the descriptor) and it compiled fine to then display a wonderful pi-powered polygon. You're most definitely right about the all warnings thing, however it just fueled my idea that the vertex shader was some hidden file cached away in the darkest recesses of the Raspbian file structure. RE: error running first example (chapter 3 triangle) - Brian Beuken - 06-08-2018 Not in the early examples, the shaders are hard coded in the openGL init, later we will use a shader manager and load individual shaders as needed. Shaders are not usually hidden away since we write them for our needs, its just a case of using the simplest approach of embedding them in the code until we're ready to explore. Really pleased you worked it out, keep bashing away. |