Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need help on something...
#1
Does anyone have a working example of using glLight without textures? I can't get it to work right... Everything that the light touches becomes 100% bright red. :roll:
Reply
#2
If you are using the vector versions, be sure to arrange your values in sequential order.

Can you post code?
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#3
Well, I figured out what I was doing wrong...

I was doing this...
Code:
Type LightType
R as Single
G as Single
B as Single
A as Single
End Type

Dim Light_Ambient as LightType

But, it should have been this...
Code:
Dim Light_Ambient(3) as Single

So, it works now. Tongue

Do you have an example of loading an Sdl_Surface into an Ogl Texture variable Texture(Width,Height,2)? I still can't get that to work right.
:roll:

EDIT:
Here's the code I tried to stick an Sdl_Surface onto an Ogl texture var with...

Texture() is ubyte
image1 is Sdl_Surface ptr

Code:
glEnable Gl_Texture_2D
glBindTexture(GL_TEXTURE_2D, Texture(0,0,0))
glTexImage2D(GL_TEXTURE_2D, 0, 3, imagew-1, imageh-1, 0, GL_RGB, GL_UNSIGNED_BYTE, image1)
Reply
#4
Why not use and array if bitmaps, load it to gl and erase the array?

Sorry dude can't code these days. :*(

BTW, you can do a very fast scroller ibn GL using glQuads, and a texture array. :*)
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#5
Cool, I got that working now too. Tongue

When are you going to get your computer fixed? Was it the power supply? :???:
Reply
#6
The PS, and the cyrix processor. Tne mobo is okay but I'm having a hard time finding a compatible processor. :*(
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#7
rel, how would one make a scroller using openGL?

I have made one now, using SDL, and blitsurface, it's fast and such, but always good to improve =)

Also, would it be possible to use openGL to morph tiles togheter?, to get nice transitions, lets say, from grass to stone, instead of razor sharp edges?
Reply
#8
Quote:The PS, and the cyrix processor. Tne mobo is okay but I'm having a hard time finding a compatible processor. :*(
PM me the details, will you?
Reply
#9
Quote:rel, how would one make a scroller using openGL?

I have made one now, using SDL, and blitsurface, it's fast and such, but always good to improve =)

Also, would it be possible to use openGL to morph tiles togheter?, to get nice transitions, lets say, from grass to stone, instead of razor sharp edges?

Easy, use glQuads. It's faster than SDL and yo can stretch, blend, morph, rotate, etc. Basically what you can so with glPerspective you can do with glOrtho.

All you have to do is call glOrtho instead of GLperspective and you can put triangles, quads, polys, lines, pixels just like QB.

Say you have a screen of 640* 480, to plot a pixel:

Code:
glBegin glPoint
       for loop for plotting points
      end loop
glend

I could post a lil demo but it's in my computer which was busted. :*(

I may make another one this weekend since I'll be coding on my sister's comp. :*)
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#10
A tutorial on how to use OpenGL for 2D games would be awesome, Rel, Wink HINT HINT Big Grin
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)