Advertisement

Transparency

Started by September 27, 2000 06:54 PM
19 comments, last by Blue*Omega 24 years, 1 month ago
Since you are looking for suggestions here is one. Why not try breaking up your code into multiple source files? Rather than stuffing everything into one file put the OpenGL windowing code in its own pair of source files, texture code in another pair and any other support code in other files. When source code is stuffed into a single file it makes it harder to work with and harder to update in the case of bugs. If you have a bug in your texture code you can just update 1 file rather than going through all of the tutorials you ever used textures in just to fix a bug in all of them. A single file may be easy when your learning "hello world", but why not teach people the proper way to code from the start? Just my two cents.
In replication to the above post, I think the sort of thing you are asking is something that must be done on your own accord.

I''m not sure Jeff set out to teach C programming or programming style per se, but rather OpenGL. Breaking up a project like the stuff Jeff teaches is more manable in multiple files, but it''s time to do something for yourself.

It''s probably a lot easier to have everything in one file from an HTML perspective anyway...

Later, Ben.
Advertisement
Yanno what I hate most about these kinds of flame posts??? The fact that I''ve got to READ so much.... Ugh. It''s too much work to find out what everyone thinks of the latest flamer, yanno... I think I''ll give up reading everyone''s opinions on flamers now and just focus on his own original opinion so that I can take pointers from him and hopefully be as cool as him some day...

S.
Using multiple source files is effortless and does not require any teaching. If someone doesn''t know how to take advantage of multiple source files they should go back to basic programming skills and let OpenGL wait. You should learn how to use the tools that are at your disposal and then move on to bigger and better things.

Breaking the source code up into multiple pieces would be very good because it would make the code easier to read, easier to maintain and would give structure to the programs. What I mean by structure is that when it comes time to load a texture, texture.cpp seems like a good place to look for the code, and when models are loaded, model.cpp would be a logical place for that code. You should assume that people know what you are doing unless you are coding something particularly nasty, if they don''t understand it''s up to them to figure it out. That''s the way you learn things, by feeling dumb about not knowing something and then going out to learn it.

Nate Miller
http://nate.scuzzy.net
I am so fuckin sick of retards like Anonymous Poster #1

Just had to say it, because it grates on my nerves.

Cel
Cel aka Razehttp://chopper2k.qgl.org
That would be Anonymous Poster #2

(sorry anon poster #1 )

Cel
Cel aka Razehttp://chopper2k.qgl.org
Advertisement
We need only registered users to be able to post on this forum,
(you can find me on IRC : #opengl on undernet)
Why is it that this entire post seems to have nothing to do with the original topic? BTW: If you want the code to be broken up into multiple files, why not do it yourself and send it to NeHe?
If he wants to post it he will. If not, well then at least you have it!

-----------------------------

Blue*Omega

(Insert Witty Quote Here)
// Tojiart
I think splitting up the code is a good idea! Initially I didn''t want to do this because I remember back when I was learning GL and C at the same time, the projects I found easiest to follow were the ones that were self contained in one file. Now that the tutorials are getting larger, and a visitors skill level by lesson 25 should be pretty good, I think it''s safe to assume splitting the files would be an option. I still have the new GL basecode that I have not yet posted. I think the next tutorial I make up after lesson 28 may introduce multiple files. If not, it will be some time soon.

Any feedback on this subject?


back to the topic of transparency, how would i order my objects if say, i want to see a room across the courtyard with glass, and your room has glass too, but if you go to the other side in the other room, and you render in the same order as before, you''ll render the far window first. how do you fix this?

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k

This topic is closed to new replies.

Advertisement