Advertisement

Seemingly random bugs.

Started by March 23, 2003 05:34 PM
4 comments, last by Jheriko 21 years, 11 months ago
I''ve been trying to program OpenGL for the past three years now and I haven''t got very far at all. I''ve read numerous tutorials, including the ones by NeHe Productions, and several books, including ''OpenGL Game Programming'' by Hawkings and Astle. I have copied source code and cut and paste sources together to make new stuff. The problems I''m having come when I try to start my own program off, I have managed to make several ''black screen frameworks'' over the past couple of years and a lot of simple incomplete programs that may be classifiable as demos, however nothing has ever gotten completed because seemingly at random my code... or a part of my code just stops working. For instance... earlier today I quickly put together a small fullscreen app displaying a rotating cube using lines and quads without any texturing. I decided to add a bitmap font ''glPrint'' function to this and it worked fine. Next I added an fps counter.. now suddenly my glPrint prints all of my text squashed to about 50% height with uneven colouration.. I tried deleteing all of the code that I had added for my fps counter but this did nothing to remedy the situation. I added the fps counter again and just decided to live with the flawed text. Next I tried to add a splash screen that blended out during the first few thousand frames... simple stuff... then when I compiled it my FPS counter had disappeared completely and once again removing the added code did not fix it. I haven''t just had this problem with my own frameworks but also with the NeHe framework and the www.game-tutorials.com framework. I have also had numerous random things just suddenly stop working... not just bitmapped fonts, once the depth test randomly stopped working... even after placing glEnable(GL_DEPTH_TEST);glDepthFunc(GL_LEQUAL); regularly throughout my code, also I''ve had texturing randomly fail leaving my polygons flat shaded. The strange thing is that I get no compiler errors or warnings when these things happen, in fact when these things start to happen I generally go through my code to remove even the small warnings like ''truncation from ''float'' to ''int'' ''. If anyone wants to look at the source for my doomed fps counter then just ask me and I can email it to you (its a fairly big project and i''d assume that you''d want to see all of it) Any help that can be given would be much appreciated, I have a fairly good knowledge of c/c++ and (presumably) rather poor knowledge of OpenGL. -- Jheriko http://jheriko.deviantart.com ''''Everything around us can be represented and understood through numbers.''''
-- Jherikohttp://jheriko.deviantart.com/''Everything around us can be represented and understood through numbers.''
Copying and pasting snippets of code often does that. One snippet changes some viewport for the rest of the code, and certain things are farther away than they should be, etc.

-~-The Cow of Darkness-~-
-~-The Cow of Darkness-~-
Advertisement
Sorry.. I did not make myself clear... the program with the fps counter was not built by copying and pasting code together. The errors popped up after I added something which I personally typed in to my code.

I guess that my problem is a little vague though. I was kind of hoping that it was quite common and that it was the fault of my compiler or .lib files and there was some update somewhere that would fix this.

-- Jheriko
http://jheriko.deviantart.com/

''''Everything around us can be represented and understood through numbers.''''
-- Jherikohttp://jheriko.deviantart.com/''Everything around us can be represented and understood through numbers.''
I used to have those kinds of problems when I was first starting with opengl. I found that the best way to learn was not to cram as much as you can into one program at first. Good luck!
-~-The Cow of Darkness-~-
Some compilers have that kind of problem. You hit the ''undo'' button a couple of times, compile, and the errors are still there. You reload your source code only to find that the ''undo'' button didn''t undo the things. Hence I make backup copies of my source code.
I looked around on your website but I couldn''t find anything resembling code... if you could paste your code either here or on your website I''d be glad to help and it would make helping a world easier...
I'm don't know much but I can try to help... just email me at... Shadow_0f_Light@Yahoo.com(the '0' in 'Of' is a zero :P)

This topic is closed to new replies.

Advertisement