Open GL question

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
ssj4goku128
Insane DCEmu
Insane DCEmu
Posts: 290
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Open GL question

Post by ssj4goku128 »

DOes anyone know how to wrap a texture around a polygon( maybe a triangle or a quad) in kos open gl? Please
"So I gotta be carefull, can't let tha evil of tha money trap me
so when ya see me #@#$%
ya better holla at me "

Tupac Shakur[1971-1996]
Makaveli[1996-????]
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

It should be the same as in OpenGL, I think. You have to load the textures differently, but everything else should be the same.
ssj4goku128
Insane DCEmu
Insane DCEmu
Posts: 290
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by ssj4goku128 »

Thats what my question is about, it is loaded quite differently. This is one of the couple of bottlenecks of implementing open gl in my libGPU library file
Any suggestions would be great
"So I gotta be carefull, can't let tha evil of tha money trap me
so when ya see me #@#$%
ya better holla at me "

Tupac Shakur[1971-1996]
Makaveli[1996-????]
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

I see...

You have to upload the textures yourself. First, you have to allocate some space with pvr_mem_malloc. Once that's done, you have to upload the texture data yourself, and the pass that information, along with any texture paramaters to GL.

Uploading it - the simplest way to upload raw data is by copying it manually. This is also the slowest way. Store Queues are faster, but DMA is faster still. I think you could probably use the pvrdma library to transfer textures to VRAM, provided they don't need to be converted to a different format first. You won't need to twiddle the textures, I assume, since the PSX doesn't use bilinear filtering.
User avatar
Covar
DCEmu Mega Fan
DCEmu Mega Fan
Posts: 2990
Joined: Sat Nov 30, 2002 8:06 am
Location: Cary, NC
Has thanked: 0
Been thanked: 0
Contact:

Post by Covar »

sorry to ask this as its probably a big noob question but, I was working on the first NeHe tutorial for windows, and when I compiled i recieved 54 errors and 23 warnings, the errors i get are ones like "GLFLOAT undeclared Identifier" and stuff like that. so i was wondering is that because i need to download OpenGL, because i had the files he said to link to in my compiler directory. or is the code just wrong and i need to learn somewhere else?

Please Help! Thank You.
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

You need the OpenGL headers and libraries. All those errors mean that you either haven't included the header files, or you don't have them. If you don't have them, the first error message will be something like "Can't open header file gl/gl.h"

NeHe's tutorials do work though, if you've got your compiler/libs/headers set up right.
Bombshell
DC Developer
DC Developer
Posts: 179
Joined: Wed Nov 20, 2002 8:29 pm
Has thanked: 0
Been thanked: 0

Post by Bombshell »

The data type is GLfloat not GLFLOAT so that could be one and yes you need to download the OpenGL libraries. If your running linux do a search for Mesa3d on google. Also if you have the libraries make sure your linking them in the compilter -lGL -lGLU -lglut I think those are the linkers for gcc.

As BlackAura Mentioned as well the header files should appear like this in your source file

Code: Select all

#include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>
...
If your still getting errors try to add this to the compiler line (providing your using linux like myself)

-lX11 -lXi -lXmu -lglut -lGL -lGLU -lm
User avatar
Covar
DCEmu Mega Fan
DCEmu Mega Fan
Posts: 2990
Joined: Sat Nov 30, 2002 8:06 am
Location: Cary, NC
Has thanked: 0
Been thanked: 0
Contact:

Post by Covar »

thanks a lot I do that and see what happens
Post Reply