Page 1 of 1

SDL Port? and how to download?

Posted: Wed May 04, 2005 4:29 am
by Thanhda
hey, just wondering this SDL_opengl port located in the CVS, does this enable full feature opengl? Also how do i download the whole di. i read the readme but doesnt work. am i supose to connect to the server first? and if so how do i do that?

Posted: Wed May 04, 2005 6:02 am
by ooPo
You must wait for an official release, or learn how to use cvs:

https://www.cvshome.org/docs/blandy.html

I don't see an SDL_opengl port located on the cvs server, however. Are you certain it exists?

Posted: Wed May 04, 2005 6:06 am
by Thanhda
yup. it exist.
http://cvs.ps2dev.org/ps2sdk-ports/sdl/ ... L_opengl.h

let me know if it is a full featured ogl for the ps2. this would be very useful. also official release? when will the official release be launch?

Posted: Wed May 04, 2005 9:48 am
by pixel
Err.... I think I remember reading you once writing you knew how to compile stuff.... This file is a header file. Nothing that contains actual code to compile. It contains "sdlified" function prototypes (read "portable") for an hypotetic OpenGL library aside the SDL. SDL by no mean contains, and will ever contain any OpenGL implementation. That's not its job. So, to answer your question "when will SDL contain OpenGL" the answer is simply "never".

Posted: Wed May 04, 2005 1:31 pm
by Thanhda
pixel wrote:Err.... I think I remember reading you once writing you knew how to compile stuff.... This file is a header file. Nothing that contains actual code to compile. It contains "sdlified" function prototypes (read "portable") for an hypotetic OpenGL library aside the SDL. SDL by no mean contains, and will ever contain any OpenGL implementation. That's not its job. So, to answer your question "when will SDL contain OpenGL" the answer is simply "never".
oh okay. well has anyone built a full feature ogl port yet? or something better then dreamgl? i'm mainly looking for a glu.h file. it seems that dreamgl doesnt include a guLookAt() function. i have tried to include one from the default dir but it gives me an error

Code: Select all

demo.o(.text+0x334): In function `demo_init':
demo.c: undefined reference to `gluLookAt'
collect2: ld returned 1 exit status
make: *** [md2view.elf] Error 1
i know when including the function along without the lookat function it works, but when i include the function it does. dont know why.

Posted: Wed May 04, 2005 2:16 pm
by cheriff
glu and glut functions aren't part of the opengl core. They make up companion/helper libraries. As far as a ps2 port goes i'd say the getting the core upto speed is more of a priority at the moment.

What default dir did you pull glu.h from? if its ps2 related there *might* be an implementation. As mentioned in another thread, you know that .h files are just the prototype or description of a given function. the actual function body is usually in an accompanying .c file or .a library.

*if* it does exist you have to link against the .o or .a containing said function, not just #include the .h file.
if it doesn't exist you can either port it or work around it.
gluLookAt is just a wrapper for a series of glRotate and glTranslate, IIRC.

Posted: Wed May 04, 2005 2:23 pm
by Thanhda
cheriff wrote:glu and glut functions aren't part of the opengl core. They make up companion/helper libraries. As far as a ps2 port goes i'd say the getting the core upto speed is more of a priority at the moment.

What default dir did you pull glu.h from? if its ps2 related there *might* be an implementation. As mentioned in another thread, you know that .h files are just the prototype or description of a given function. the actual function body is usually in an accompanying .c file or .a library.

*if* it does exist you have to link against the .o or .a containing said function, not just #include the .h file.
if it doesn't exist you can either port it or work around it.
gluLookAt is just a wrapper for a series of glRotate and glTranslate, IIRC.
i pulled the glu.h file from the /usr/includes/GL/ folder, and yes i know what the .h files are. i did not only grab just the .h file i also grab the lib file as well, but as you mention it needs to be a .o or .a file. the file i have is a .lib file which i downloaded off the net(could be reason its not working). I may be new to ps2 programming, and linux, but i know how api's work and how to link them. my main question is if there is some sort of implementation process(which there is most likely), but in windows. all you go to do is link the files and include them and it works. Of course this is not windows, this is linux, but i would have presume they were some what a like. I am using the dreamGL sample as a test. located at dream_gl/contrib/dfreak/. it comes with 2 main files, one for windows and the other for ps2. and i am currently modifiying demo.c. in Windows of course it works just great, when trying to include glu.h or sdl_opengl.h, but in linux on the otherhand gives me a problem.

Posted: Wed May 04, 2005 2:24 pm
by ooPo
http://www.devmaster.net/forums/index.p ... topic=3145
It's pretty simple to build your own look-at matrix.

First, calculate forward, right, and up vectors. The forward vector should be a unit vector pointing in the direction that your camera is looking. The right and up vectors must be unit vectors, and perpendicular to each other and the forward vector. How to come up with these vectors is a matter of how your camera works, so I won't go into more detail (unless you ask).

Now, make a 3x3 matrix that has as its first row, the right vector; as its second row, the up vector; and as its third row, the NEGATIVE of the forward vector (this is so the forward vector maps onto the negative Z axis, which is the usual behavior for gluLookAt).

Finally, expand this matrix into a 4x4 (by adding a 1 in the lower-right corner and zeros elsewhere), and multiply it by a translation matrix that takes your camera location to the origin (i.e. the translation is by the negative of the camera location). And you've got a look-at matrix.
Google is your friend.

Posted: Wed May 04, 2005 2:27 pm
by cheriff
ok. well in that case there is no glu implementation for ps2. Taking the ones for /usr/GL wont do anygood because they're targeted to x86/ppc/whatever and not the ps2. If you were linking against them, i'm suprised the link process actually got that far.

Posted: Wed May 04, 2005 2:29 pm
by Thanhda
ooPo wrote:http://www.devmaster.net/forums/index.p ... topic=3145
It's pretty simple to build your own look-at matrix.

First, calculate forward, right, and up vectors. The forward vector should be a unit vector pointing in the direction that your camera is looking. The right and up vectors must be unit vectors, and perpendicular to each other and the forward vector. How to come up with these vectors is a matter of how your camera works, so I won't go into more detail (unless you ask).

Now, make a 3x3 matrix that has as its first row, the right vector; as its second row, the up vector; and as its third row, the NEGATIVE of the forward vector (this is so the forward vector maps onto the negative Z axis, which is the usual behavior for gluLookAt).

Finally, expand this matrix into a 4x4 (by adding a 1 in the lower-right corner and zeros elsewhere), and multiply it by a translation matrix that takes your camera location to the origin (i.e. the translation is by the negative of the camera location). And you've got a look-at matrix.
Google is your friend.
yes google is a friend for sure. i have already found a few things similar, but i am trying to see if anyone has built one already, (not so good in math). if i have yet to find already pre existing api that includes a camera class i will have no choice to do it that method. Thanks anyway.

Posted: Wed May 04, 2005 2:29 pm
by J.F.
What would be nice would be a port of MESA to the PS2. I think its license is compatible with the ps2dev license.

Posted: Wed May 04, 2005 2:30 pm
by Thanhda
cheriff wrote:ok. well in that case there is no glu implementation for ps2. Taking the ones for /usr/GL wont do anygood because they're targeted to x86/ppc/whatever and not the ps2. If you were linking against them, i'm suprised the link process actually got that far.
well its posible that i did not include the right lib file. but, by the looks of things i would have to create my own cam class. btw, is there no glut implementation for a ps2? i know ps2gl has it implementated but thats only works on the ps2linux.

Posted: Wed May 04, 2005 2:40 pm
by Thanhda
J.F. wrote:What would be nice would be a port of MESA to the PS2. I think its license is compatible with the ps2dev license.
and what is MESA? btw it seems that i do need to create a camera class.

to: oopo, have you done a camera class before? and by any chance would like to share it? if not thats alright, and thanks for all the help.

Posted: Wed May 04, 2005 4:59 pm
by Drakonite
Thanhda wrote:
J.F. wrote:What would be nice would be a port of MESA to the PS2. I think its license is compatible with the ps2dev license.
and what is MESA? btw it seems that i do need to create a camera class.

to: oopo, have you done a camera class before? and by any chance would like to share it? if not thats alright, and thanks for all the help.
You talk a lot of shit about linux to not know what Mesa is.

Posted: Wed May 04, 2005 6:09 pm
by Thanhda
Drakonite wrote:
Thanhda wrote:
J.F. wrote:What would be nice would be a port of MESA to the PS2. I think its license is compatible with the ps2dev license.
and what is MESA? btw it seems that i do need to create a camera class.

to: oopo, have you done a camera class before? and by any chance would like to share it? if not thats alright, and thanks for all the help.
You talk a lot of shit about linux to not know what Mesa is.
please let me know how this is helpful to the related topic? are you here to always bash people? and i just said its easier to set up a toolchain in linux then it is to in windows. that doesnt mean i'm a linux guru. sheesh.

Posted: Wed May 04, 2005 7:14 pm
by blackdroid
easier for you maybe. wich doesnt say alot really.

Posted: Wed May 04, 2005 7:16 pm
by Drakonite
Thanhda wrote:
Drakonite wrote:
Thanhda wrote: and what is MESA? btw it seems that i do need to create a camera class.

to: oopo, have you done a camera class before? and by any chance would like to share it? if not thats alright, and thanks for all the help.
You talk a lot of shit about linux to not know what Mesa is.
please let me know how this is helpful to the related topic? are you here to always bash people? and i just said its easier to set up a toolchain in linux then it is to in windows. that doesnt mean i'm a linux guru. sheesh.
You said a lot more than that (I won't dredge up exactly as we don't need a fight started), and it's also in your tone. You speak as though you are the expert and everyone else is wrong, despite the fact it appears you often don't know what you are talking about. -- If you haven't noticed, you've been pissing off a few of the people who have to then turn around and clean up the misinformation.

My post might have bashed you a bit but it also told you where to find the info you needed.
HINT: Take the two keywords from my post ("linux" "mesa") and plug them into google.

Most of my posts are more carefully crafted than you think... "You" addressed who I was talking to, "linux" and "mesa" are very good keywords, and the only other noun in the post describes what I think porting Mesa to PS2 would be like.

If you have a problem with me then feel free to send a PM to me.

Posted: Wed May 04, 2005 8:42 pm
by Neil Stevens
Wouldn't Mesa be way too slow to be of any use?

Posted: Wed May 04, 2005 9:03 pm
by pixel
Neil Stevens wrote:Wouldn't Mesa be way too slow to be of any use?
Yeah, I guess that too...

Posted: Thu May 05, 2005 4:55 am
by J.F.
MESA is an open source implementation of OpenGL. It is supports many different OSes and hardware acceleration on a variety of cards. If there is no hardware 3D, it's pretty slow. If there is hardware 3D acceleration, it's pretty good. For example, my notebook uses the Unichrome DRI hw accelerated MESA and plays Quake3 level games pretty nicely.

http://www.mesa3d.org