Betreff: Farbechtheit beim Overlay
Was ist hier ein optimaler Weg ?
Code: Alles auswählen
Procedure glDraw3DImage(x.f,y.f,z.f,Img.i,w.f=0,h.f=0)
Protected Dim ccol.f(3)
If IsImage(Img)
If w = 0
w = ImageWidth(Img)
EndIf
If h = 0
h = ImageHeight(Img)
EndIf
glGetFloatv_(#GL_CURRENT_COLOR, @ccol())
glPushMatrix_()
glMatrixMode_(#GL_MODELVIEW)
glColor4f_(1.0,1.0,1.0,1.0) ;WICHTIG!
glBindTexture_(#GL_TEXTURE_2D, GTex(Img))
glEnable_(#GL_BLEND)
glBlendFunc_(#GL_SRC_COLOR, #GL_DST_COLOR) ;Wie bekomme ich das mit der Farbechtheit hin ? Was ist hier die optimale Lösung ?
glBegin_(#GL_QUADS)
glTexCoord3f_(0,0,z)
glVertex3f_(x,y,z)
glTexCoord3f_(1,0,z)
glVertex3f_(x+w,y,z)
glTexCoord3f_(1,1,z)
glVertex3f_(x+w,y+h,z)
glTexCoord3f_(0,1,z)
glVertex3f_(x,y+h,z)
glEnd_()
glBindTexture_(#GL_TEXTURE_2D, 0)
glDisable_(#GL_BLEND)
glPopMatrix_()
glFinish_()
glColor4f_(ccol(0),ccol(1),ccol(2),ccol(3))
EndIf
EndProcedure
Betriebssysteme: div. Windows, Linux, Unix - Systeme
no Keyboard, press any key
no mouse, you need a cat