
-----------------------------------
Kuntzy
Sat Sep 11, 2004 4:59 pm

First OpenGL Program Involving Resourses, Textures, &amp; Te
-----------------------------------
This is My first program  :
press the arrow keys to move the big box
press the n key to make small box appear
press b for blending
wsad for moving the small box
L for screwed up lighting (i think the light is rotating, but i don't want it to)

-----------------------------------
Catalyst
Sun Sep 12, 2004 10:42 am


-----------------------------------
Good Job :D have 25 bits
welcome to the wonderful world of opengl

-----------------------------------
Kuntzy
Sun Sep 12, 2004 3:15 pm


-----------------------------------
Thanx Catalyst ... one question, have you ever worked with resources, and loading textures off them? I ask because at the moment I am using Neon Helium's function for loading the BMP texture ... and I am having trouble modifiying it  to suit what I want to do ...

-----------------------------------
Catalyst
Sun Sep 12, 2004 3:25 pm


-----------------------------------
Nope, never worked with resources

-----------------------------------
hq78
Sat Dec 18, 2004 6:23 pm


-----------------------------------
thats such a sick program, wow i love it good work

-----------------------------------
md
Sun Dec 19, 2004 3:40 am


-----------------------------------
'Tis very nice, but is it really your first program? or is it your first GL program... cause it seems like a lot of people are posting saying "this is my first program" when they are using things that they must have learned by writing other programs, and to be honest I just can't wrap my mind arround that (I must be old school :P ).

Back in the day, we started with 

#include 

int main()
{
    puts("Hello World!");
}


:)

-----------------------------------
Mazer
Sun Dec 19, 2004 9:38 am


-----------------------------------
Besides the fact that this post is, what, 4 months old? I'm guessing he indeed meant his first opengl program. But at the risk of wrongfully accusing him, I would also guess it was more of a copy/paste with some changes kind of thing.

Cornflake: I'm almost certain you meant to return 0 back there, but maybe I don't know as much about C as I thought.  :wink:

-----------------------------------
md
Sun Dec 19, 2004 2:35 pm


-----------------------------------
lol I didn't notice the original post date, and yes I should have returned 0 :)

-----------------------------------
Andy
Sun Dec 19, 2004 5:21 pm


-----------------------------------
i dont understand why they tell us to return 0.. it makes alot more sense if we returned 1 seeing as how 1 is true and 0 if false

-----------------------------------
Catalyst
Sun Dec 19, 2004 5:48 pm


-----------------------------------
seeing how it is meant to show if the program encountered any errors 0 seems appropriate

-----------------------------------
Andy
Sun Dec 19, 2004 6:31 pm


-----------------------------------
still dont get it... if the program runs into problems, then it wouldnt even return anything...

-----------------------------------
md
Sun Dec 19, 2004 6:53 pm


-----------------------------------
It comes from most modern operating systems unix heritage, but basically you return >= 0 for no errors (i think...), and < 0 if a non-fatal error occurs. In most modern operating systems all errors are caught and the program is signaled, so a program always returns something.

It's original purpose was when unix didn't have thread suport, so instead new processes were forked off to do work. By checking the return value you could tell if the process did what it was supposed to do. When threads became comon place the same system was copied because it was proven. Today Unix (and linux) support user level threads through pthreads, and windows supports threads natively, but each process still returns an int value for legacy reasons.

**Windows programs return an int, because 32bit windows lakes lots of ideas from unix.

-----------------------------------
Andy
Sun Dec 19, 2004 7:20 pm


-----------------------------------
ooo.. thx for that very informative response.. +20 bits

-----------------------------------
Mazer
Sun Dec 19, 2004 9:31 pm


-----------------------------------
Here's my respons: I return 0 so that I have one more way by which to show that I code nothing like my retard of a professor. May God strike her down with several bolts of lightning.

Oh yeah, and I prefer platform-independent code.

-----------------------------------
Andy
Mon Dec 20, 2004 2:45 pm


-----------------------------------
hmm what does she do? void?

-----------------------------------
Martin
Wed Jan 05, 2005 6:00 pm


-----------------------------------
unsigned char main()

:P

-----------------------------------
Kuntzy
Wed Jan 05, 2005 11:36 pm


-----------------------------------
I resent the copy and pasting comment by the way ... geeze, i didn't build it from sktratch but its mostly my work ... u'd think i'd make sumthing better than a box if it was stolen ...

-----------------------------------
Martin
Thu Jan 06, 2005 9:29 pm


-----------------------------------
Ignore them. The internet is for flames.
