Jump to content

  • Log In with Google      Sign In   
  • Create Account


zaneski13

Member Since 11 Oct 2009
Offline Last Active Jun 21 2012 11:41 PM

Posts I've Made

In Topic: Top Down Rpg

16 April 2012 - 11:53 AM

Posted Image yup right here. working on the engine though. a lot more programming and testing to be done. Working on the lighting system right now. then I'll try to implement shadows, then ill rewrite the engine with everything i know. Going for a diablo 2 look

In Topic: sphere vs isometric frustum collision

03 April 2012 - 05:14 PM

How would one go about finding the 4 planes of the isometric 3D camera? The 4 planes being left, right, top bottom. Dont really care about near and far because its a 2.5 D isometric game so lights wont be above the camera or below the floor.

The camera data I have access to in my engine is the position, rotation, modelview matrix, projection matrix.

In Topic: glTexSubImage2D not working with GL_RGB or GL_LUMINANCE textures [SOLVED]

29 February 2012 - 12:36 PM

Thanks for clarifying! Posted Image
I can move onto my editor now

In Topic: glTexSubImage2D not working with GL_RGB or GL_LUMINANCE textures [SOLVED]

29 February 2012 - 12:26 PM

Heres what I have for code at the moment

bool TextureEditable::SetSubData(int x, int y, int w, int h, unsigned char *pixels)
{
if ( !pixels )
  return false;
if ( x < 0 || x >= width || y < 0 || y >= height )
  return false;


Texture::EnableGLTextures();
glBindTexture(GL_TEXTURE_2D, texID);
Texture::lastBoundTexture = texID;
if (format == TEX_RGBA )
{
  glPixelStorei( GL_UNPACK_ALIGNMENT, 4);
  glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
}
else if ( format == TEX_RGB )
{
  glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGB, GL_UNSIGNED_BYTE, pixels);
}
else if ( format == TEX_ALPHA )
{
  glPixelStorei( GL_UNPACK_ALIGNMENT, 1);
  glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_LUMINANCE, GL_UNSIGNED_BYTE, &pixels[0]);
}

}

Right now TEX_RGBA and TEX_ALPHA formats are working. idk what to do about TEX_RGB since '3' isnt a valid value to pass to glPixelStore

In Topic: glTexSubImage2D not working with GL_RGB or GL_LUMINANCE textures [SOLVED]

29 February 2012 - 12:05 PM

Thanks, that sounds like the function I should be using. Just a question. I checked the reference guide for glPixelStore and the parameter GL_UNPACK_ALIGNMENT, and appariently the only valid values you can pass to the function is 1,2,4, or 8. According to http://www.talisman.org/opengl-1.1/Reference/glPixelStore.html

So when the pixel data I'm passing to the texture is GL_LUMIANCE I'd call glPixelStore(GL_UNPACK_ALIGNMENT, 1); before calling glTexSubImage2D()
But, when the pixel data I'm passing to the texture is GL_RGB I'd call glPixelStore(GL_UNPACK_ALIGNMENT, 3) before calling glTexSubImage2D() but '3' isn't a valid value to pass to glPixelStore(GL_UNPACK_ALIGNMENT, n); According to the link above, only 1,2,4, and 8 are valid values. 1 being (L,L,L,1) 2 being (L,L,L,A) ??? 4 being (R,G,B,A) 8 being (R,G,B,A,ummmmmmmmmm idk)

PARTNERS