here is a bit of code to try to show what im getting at i dont know if this can be done or not though,
#Include "GenioGl\GenioGl.bi"
GenioGraphics( 800 , 600 , 32 , WINDOWED )
Type KeyTracker
Key As Ubyte ptr
Esckey as Uinteger
Up As uinteger
Down As Uinteger
KLeft As Uinteger
KRight As Uinteger
Z As Uinteger
End Type
Declare sub GenioCheckKeys ( Keys As KeyTracker )
Declare Function CreateTextureBuffer ( Byval TWidth As Double , Byval THeight As Double ) As GLuByte PTR
Declare Function CopyTexture ( Destination As GLuint , Byval Source As GLuint PTR )
Dim Shared As GLuint PTR TextureBuffer
Dim Shared As GLuint Texture
TextureBuffer = CreateTextureBuffer( 512 , 512 )
glGenTextures( 1, @Texture )
glBindTexture( GL_TEXTURE_2D , Texture )
glTexParameteri( GL_TEXTURE_2D , GL_TEXTURE_WRAP_T, GL_CLAMP)
glTexParameterf( GL_TEXTURE_2D , GL_TEXTURE_MAG_FILTER, GL_LINEAR)
glTexParameteri( GL_TEXTURE_2D , GL_TEXTURE_MIN_FILTER, GL_LINEAR)
glTexImage2D( GL_TEXTURE_2D , 0 , GL_RGB , 512 , 512 , 0 , GL_RGB , GL_UNSIGNED_SHORT_5_6_5 , 0)
Dim Shared Key As KeyTracker
Do
GenioClear()
GenioCheckKeys( Key )
For Y = 0 To 512 * 512
TextureBuffer[Y] = rgb(255,0,0)
Next
glBindTexture( GL_TEXTURE_2D , Texture )
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 512, 512 , GL_RGB , GL_UNSIGNED_SHORT_5_6_5 , TextureBuffer)
GenioBltSprite( Texture , 0 , 0 , 800 , 600 )
GenioRender()
LOOP WHILE Key.esckey <> 1
If ( TextureBuffer ) Then Deallocate( TextureBuffer )
Function CreateTextureBuffer( Byval TWidth As Double , Byval THeight As Double ) As GLuint PTR
Dim Ddata as GLuint ptr
Ddata = callocate ( TWidth * THeight )
Return Ddata
End Function
sub GenioCheckKeys( Keys As KeyTracker )
SDL_PumpEvents
Keys.Key = SDL_GetKeyState(0)
Keys.Esckey = Peek( Keys.Key + SDLK_ESCAPE )
Keys.Up = peek( Keys.Key + SDLK_UP )
Keys.Down = peek( Keys.Key + SDLK_DOWN )
Keys.KLeft = peek( Keys.Key + SDLK_LEFT )
Keys.KRight = peek( Keys.Key + SDLK_RIGHT )
Keys.Z = peek( Keys.Key + SDLK_Z )
end sub
so what im trying to do each frame is update my texture like this
texture[y]= rgb(255,0,0)
instead of
texture[y] = 255
texture[y+1] = 0
texture[y+2] = 0