Changeset 99 for Include/abgl.ab


Ignore:
Timestamp:
Feb 14, 2007, 4:36:09 AM (18 years ago)
Author:
NoWest
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/abgl.ab

    r88 r99  
    607607
    608608Public /* static method */
    609     Static Function FromRGB(r As GLbyte, g As GLbyte, b As GLbyte) As Color3f
    610         Dim ret As Color3f(r/255,g/255,b/255)
     609    Static Function FromRGB(r As GLubyte, g As GLubyte, b As GLubyte) As Color3f
     610        Dim ret As Color3f((r As GLfloat)/255.0 As GLfloat,(g As GLfloat)/255.0 As GLfloat,(b As GLfloat)/255.0 As GLfloat)
    611611        Return ret
    612612    End Function
    613613    Static Function FromCOLORREF(c As COLORREF) As Color3f
    614         Dim ret As Color3f((c and &hff)/255,(c>>8 and &hff)/255,(c>>16 and &hff)/255)
     614        Dim ret As Color3f((c and &hff) As GLfloat/255,(c>>8 and &hff) As GLfloat/255,(c>>16 and &hff) As GLfloat/255)
    615615        Return ret
    616616    End Function
     
    725725
    726726Public /* static method */
    727     Static Function FromRGB(r As GLbyte, g As GLbyte, b As GLbyte) As Color3d
     727    Static Function FromRGB(r As GLubyte, g As GLubyte, b As GLubyte) As Color3d
    728728        Dim ret As Color3d(r/255,g/255,b/255)
    729729        Return ret
     
    871871
    872872Public /* static method */
    873     Static Function FromRGB(r As GLbyte, g As GLbyte, b As GLbyte) As Color4f
     873    Static Function FromRGB(r As GLubyte, g As GLubyte, b As GLubyte) As Color4f
    874874        Dim ret As Color4f(r/255,g/255,b/255,1.0)
    875875        Return ret
     
    10061006
    10071007Public /* static method */
    1008     Static Function FromRGB(r As GLbyte, g As GLbyte, b As GLbyte) As Color4d
     1008    Static Function FromRGB(r As GLubyte, g As GLubyte, b As GLubyte) As Color4d
    10091009        Dim ret As Color4d(r/255,g/255,b/255,1.0)
    10101010        Return ret
     
    10611061
    10621062
    1063 
    10641063Class Light
    10651064Private
     
    10681067Public
    10691068    Sub Enabled(enabled As GLboolean)
     1069        If enabled Then
     1070            glEnable(Number)
     1071        Else
     1072            glDisable(Number)
     1073        End If
     1074    End Sub
     1075    Function Enabled() As GLboolean
    10701076        Dim lighting As GLboolean
    10711077        glGetBooleanv(Number,VarPtr(lighting))
    10721078        Return lighting
    1073     End Sub
    1074     Function Enable() As GLboolean
    1075         If enabled Then
    1076             glEnable(Number)
    1077         Else
    1078             glDisable(Number)
    1079         End If
    10801079    End Function
    10811080
     
    14141413End Class
    14151414
    1416 Class RenderState
     1415Class RenderStateManager
    14171416Public /* Composiotion */
    14181417    LightModel As LightModel
     
    15701569    End Sub
    15711570
    1572     Function FogColor() As *GLfloat
    1573         glGetFloatv(GL_FOG_COLOR,FogColor)
    1574         Return FogColor
    1575     End Function
    1576     Sub FogColor(fcolor As *GLfloat)
    1577         glFogfv(GL_FOG_COLOR,fcolor)
     1571    Function FogColor() As Color4f
     1572        Dim ret As Color4f
     1573        glGetFloatv(GL_FOG_COLOR,VarPtr(ret.rgba))
     1574        Return ret
     1575    End Function
     1576    Sub FogColor(fcolor As Color4f)
     1577        glFogfv(GL_FOG_COLOR,VarPtr(fcolor.rgba))
    15781578    End Sub
    15791579
     
    17351735Public /* Composiotion */
    17361736    Material As Material
    1737     RenderState As RenderState
     1737    RenderState As RenderStateManager
    17381738    Transform As Transform
    17391739    Lights[ELM(8)] As Light
Note: See TracChangeset for help on using the changeset viewer.