Fixes for Win32 build
This commit is contained in:
@@ -24,6 +24,7 @@ namespace osg {
|
||||
#define GL_TEXTURE0 0x84C0
|
||||
#endif
|
||||
|
||||
|
||||
/** macro for use with osg::StateAttrbiute::apply methods for detected and
|
||||
* reporting OpenGL error messages.*/
|
||||
#define OSG_GL_DEBUG(message) \
|
||||
@@ -358,48 +359,12 @@ class SG_EXPORT State : public Referenced
|
||||
|
||||
/** set the current tex coord array texture unit, return true if selected, false if selection failed such as when multitexturing is not supported.
|
||||
* note, only updates values that change.*/
|
||||
inline bool setClientActiveTextureUnit( unsigned int unit )
|
||||
{
|
||||
if (unit!=_currentClientActiveTextureUnit)
|
||||
{
|
||||
static ActiveTextureProc s_glClientActiveTexture =
|
||||
(ActiveTextureProc) osg::getGLExtensionFuncPtr("glClientActiveTexture","glClientActiveTextureARB");
|
||||
|
||||
if (s_glClientActiveTexture)
|
||||
{
|
||||
s_glClientActiveTexture(GL_TEXTURE0+unit);
|
||||
_currentClientActiveTextureUnit = unit;
|
||||
}
|
||||
else
|
||||
{
|
||||
return unit==0;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool setClientActiveTextureUnit( unsigned int unit );
|
||||
|
||||
|
||||
/** set the current texture unit, return true if selected, false if selection failed such as when multitexturing is not supported.
|
||||
* note, only updates values that change.*/
|
||||
inline bool setActiveTextureUnit( unsigned int unit )
|
||||
{
|
||||
if (unit!=_currentActiveTextureUnit)
|
||||
{
|
||||
static ActiveTextureProc s_glActiveTexture =
|
||||
(ActiveTextureProc) osg::getGLExtensionFuncPtr("glActiveTexture","glActiveTextureARB");
|
||||
|
||||
if (s_glActiveTexture)
|
||||
{
|
||||
s_glActiveTexture(GL_TEXTURE0+unit);
|
||||
_currentActiveTextureUnit = unit;
|
||||
}
|
||||
else
|
||||
{
|
||||
return unit==0;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool setActiveTextureUnit( unsigned int unit );
|
||||
|
||||
|
||||
|
||||
@@ -523,7 +488,6 @@ class SG_EXPORT State : public Referenced
|
||||
return false;
|
||||
}
|
||||
|
||||
typedef void (APIENTRY * ActiveTextureProc) (GLenum texture);
|
||||
|
||||
typedef std::map<StateAttribute::GLMode,ModeStack> ModeMap;
|
||||
typedef std::vector<ModeMap> TextureModeMapList;
|
||||
|
||||
@@ -163,7 +163,7 @@ class MySceneView : public osgUtil::SceneView {
|
||||
// override the basic SceneView::app traversal.
|
||||
virtual void app()
|
||||
{
|
||||
osgUtil::SceneView::app();
|
||||
SceneView::app();
|
||||
switch (_viewerMode)
|
||||
{
|
||||
case(MASTER):
|
||||
|
||||
@@ -108,7 +108,7 @@ int main( int argc, char **argv )
|
||||
}
|
||||
else
|
||||
{
|
||||
notify(osg::NOTICE)<<"unable to load reflect map, model will not be mutlitextured"<<endl;
|
||||
osg::notify(osg::NOTICE)<<"unable to load reflect map, model will not be mutlitextured"<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -392,3 +392,48 @@ Polytope State::getViewFrustum() const
|
||||
cv.transformProvidingInverse((*_modelView)*(*_projection));
|
||||
return cv;
|
||||
}
|
||||
|
||||
typedef void (APIENTRY * ActiveTextureProc) (GLenum texture);
|
||||
|
||||
bool State::setClientActiveTextureUnit( unsigned int unit )
|
||||
{
|
||||
if (unit!=_currentClientActiveTextureUnit)
|
||||
{
|
||||
static ActiveTextureProc s_glClientActiveTexture =
|
||||
(ActiveTextureProc) osg::getGLExtensionFuncPtr("glClientActiveTexture","glClientActiveTextureARB");
|
||||
|
||||
if (s_glClientActiveTexture)
|
||||
{
|
||||
s_glClientActiveTexture(GL_TEXTURE0+unit);
|
||||
_currentClientActiveTextureUnit = unit;
|
||||
}
|
||||
else
|
||||
{
|
||||
return unit==0;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/** set the current texture unit, return true if selected, false if selection failed such as when multitexturing is not supported.
|
||||
* note, only updates values that change.*/
|
||||
bool State::setActiveTextureUnit( unsigned int unit )
|
||||
{
|
||||
if (unit!=_currentActiveTextureUnit)
|
||||
{
|
||||
static ActiveTextureProc s_glActiveTexture =
|
||||
(ActiveTextureProc) osg::getGLExtensionFuncPtr("glActiveTexture","glActiveTextureARB");
|
||||
|
||||
if (s_glActiveTexture)
|
||||
{
|
||||
s_glActiveTexture(GL_TEXTURE0+unit);
|
||||
_currentActiveTextureUnit = unit;
|
||||
}
|
||||
else
|
||||
{
|
||||
return unit==0;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user