Commit 2c897e26 authored by ledig's avatar ledig
Browse files

[FIX] compiles with MSVC and unity build

parent f0b3fac8
......@@ -25,7 +25,7 @@ IF( NOT OW_BUILD_AS_ONE_BIG_FILE )
ADD_LIBRARY( ${LIB_NAME} SHARED ${${LIB_NAME}_COMBINER_SRC} )
ENDIF( NOT OW_BUILD_AS_ONE_BIG_FILE )
TARGET_LINK_LIBRARIES( ${LIB_NAME} ${Boost_LIBRARIES} ${CMAKE_DL_LIBS} )
TARGET_LINK_LIBRARIES( ${LIB_NAME} ${Boost_LIBRARIES} ${CMAKE_DL_LIBS} ${OPENSCENEGRAPH_LIBRARIES} )
IF(MSVC_IDE)
SET_TARGET_PROPERTIES( ${LIB_NAME} PROPERTIES PREFIX "../")
......
......@@ -116,6 +116,8 @@ WColor convertHSVtoRGBA( double h, double s, double v )
return WColor( r, g, b, 1.0f );
}
// Note (ledig): this is totaly ambigous becaus its already defined for osg::vec4f so would someone compile ow with unity buuild it fails
#if 0
std::ostream& operator<<( std::ostream& out, const WColor& c )
{
return out << c[0] << ";" << c[1] << ";" << c[2] << ";" << c[3];
......@@ -139,6 +141,7 @@ std::istream& operator>>( std::istream& in, WColor& c )
return in;
}
#endif
WColor inverseColor( const WColor& other )
{
......
......@@ -30,6 +30,8 @@
#include <osg/Vec4>
#include <osg/io_utils> // for the operator<< and operator>> for Vec4
#include "WExportCommon.h"
/**
* Represents a RGBA Color.
*/
......@@ -46,7 +48,7 @@ typedef osg::Vec4 WColor;
*
* \return The same color but in rgba format.
*/
WColor convertHSVtoRGBA( double h, double s, double v );
WColor OWCOMMON_EXPORT convertHSVtoRGBA( double h, double s, double v );
/**
* Computes the inverse of this color in means of RGB space. The alpha value is untouched.
......@@ -55,7 +57,7 @@ WColor convertHSVtoRGBA( double h, double s, double v );
*
* \param other The color (RGBA) from which the inverse should be calculated.
*/
WColor inverseColor( const WColor& other );
WColor OWCOMMON_EXPORT inverseColor( const WColor& other );
/**
* Some default colors.
......
......@@ -234,7 +234,7 @@ public:
*
* \return the iterator pointing to the found element.
*/
typename WSharedSequenceContainer< S >::Iterator find( const typename S::value_type& value );
typename WSharedSequenceContainer< S >::ConstIterator find( const typename S::value_type& value );
protected:
......@@ -392,7 +392,7 @@ typename WSharedSequenceContainer< S >::Iterator WSharedSequenceContainer< S >::
}
template < typename S >
typename WSharedSequenceContainer< S >::Iterator WSharedSequenceContainer< S >::find( const typename S::value_type& value )
typename WSharedSequenceContainer< S >::ConstIterator WSharedSequenceContainer< S >::find( const typename S::value_type& value )
{
typename WSharedObject< S >::ReadTicket a = WSharedObject< S >::getReadTicket();
return std::find( a->get().begin(), a->get().end(), value );
......
......@@ -186,7 +186,8 @@ namespace wge
* \param prefix if specified, defines the uniform name prefix. (Sampler, Unit, Sizes, ...)
* \tparam T the type of texture. Usually osg::Texture3D or osg::Texture2D.
*/
void bindTexture( osg::ref_ptr< osg::Node > node, osg::ref_ptr< WDataTexture3D_2 > texture, size_t unit = 0, std::string prefix = "" );
void OWDATAHANDLER_EXPORT bindTexture( osg::ref_ptr< osg::Node > node, osg::ref_ptr< WDataTexture3D_2 > texture,
size_t unit = 0, std::string prefix = "" );
}
template < typename T >
......
......@@ -58,7 +58,7 @@ IF( NOT OW_BUILD_AS_ONE_BIG_FILE )
ADD_LIBRARY( ${LIB_NAME} SHARED ${${LIB_NAME}_COMBINER_SRC} )
ENDIF( NOT OW_BUILD_AS_ONE_BIG_FILE )
TARGET_LINK_LIBRARIES( ${LIB_NAME} ${OWCommonName} ${OPENGL_gl_LIBRARY} ${OPENSCENEGRAPH_LIBRARIES} )
TARGET_LINK_LIBRARIES( ${LIB_NAME} ${OWCommonName} ${OWDatahandlerName} ${OPENGL_gl_LIBRARY} ${OPENSCENEGRAPH_LIBRARIES} )
IF(MSVC_IDE)
SET_TARGET_PROPERTIES( ${LIB_NAME} PROPERTIES PREFIX "../")
......
......@@ -61,7 +61,7 @@ namespace wge
* \tparam T the type of texture. Usually osg::Texture3D or osg::Texture2D.
*/
template < typename T >
void WGE_EXPORT bindTexture( osg::ref_ptr< osg::Node > node, osg::ref_ptr< T > texture, size_t unit = 0, std::string prefix = "" );
void bindTexture( osg::ref_ptr< osg::Node > node, osg::ref_ptr< T > texture, size_t unit = 0, std::string prefix = "" );
/**
* Binds the specified texture to the specified unit. It automatically adds several uniforms which then can be utilized in the shader:
......@@ -79,7 +79,7 @@ namespace wge
* \tparam T the type of texture. Usually osg::Texture3D or osg::Texture2D.
*/
template < typename T >
void WGE_EXPORT bindTexture( osg::ref_ptr< osg::Node > node, osg::ref_ptr< WGETexture< T > > texture, size_t unit = 0, std::string prefix = "" );
void bindTexture( osg::ref_ptr< osg::Node > node, osg::ref_ptr< WGETexture< T > > texture, size_t unit = 0, std::string prefix = "" );
/**
* Removes the binding associated with the specified unit.
......@@ -105,7 +105,7 @@ namespace wge
*
* \return the generated texture.
*/
osg::ref_ptr< WGETexture< osg::Texture1D > > genWhiteNoiseTexture( size_t sizeX, size_t channels );
osg::ref_ptr< WGETexture< osg::Texture1D > > WGE_EXPORT genWhiteNoiseTexture( size_t sizeX, size_t channels );
/**
* This generates an 2D texture only containing white noise in its channels.
......@@ -116,7 +116,7 @@ namespace wge
*
* \return the generated texture.
*/
osg::ref_ptr< WGETexture< osg::Texture2D > > genWhiteNoiseTexture( size_t sizeX, size_t sizeY, size_t channels );
osg::ref_ptr< WGETexture< osg::Texture2D > > WGE_EXPORT genWhiteNoiseTexture( size_t sizeX, size_t sizeY, size_t channels );
/**
* This generates an 3D texture only containing white noise in its channels.
......@@ -128,7 +128,7 @@ namespace wge
*
* \return the generated texture.
*/
osg::ref_ptr< WGETexture< osg::Texture3D > > genWhiteNoiseTexture( size_t sizeX, size_t sizeY, size_t sizeZ, size_t channels );
osg::ref_ptr< WGETexture< osg::Texture3D > > WGE_EXPORT genWhiteNoiseTexture( size_t sizeX, size_t sizeY, size_t sizeZ, size_t channels );
/**
* Generates an image only containing white noise in its channels.
......@@ -140,7 +140,7 @@ namespace wge
*
* \return the generated image.
*/
osg::ref_ptr< osg::Image > genWhiteNoiseImage( size_t sizeX, size_t sizeY, size_t sizeZ, size_t channels = 1 );
osg::ref_ptr< osg::Image > WGE_EXPORT genWhiteNoiseImage( size_t sizeX, size_t sizeY, size_t sizeZ, size_t channels = 1 );
}
template < typename T >
......
......@@ -35,7 +35,7 @@
* here. If a bool prop is used, the callback can trigger between child 0 and 1. Technically, WPropDouble is also possible.
*/
template < typename PropType >
class WGE_EXPORT WGESwitchCallback: public osg::NodeCallback
class WGESwitchCallback: public osg::NodeCallback
{
public:
/**
......
......@@ -38,7 +38,7 @@
* This class is able to provide arbitrary values as define statements in GLSL code.
*/
template< typename ValueType = bool >
class WGE_EXPORT WGEShaderDefine: public WGEShaderPreprocessor
class WGEShaderDefine: public WGEShaderPreprocessor
{
public:
/**
......
......@@ -54,7 +54,7 @@ class WGEShaderPropertyDefineOptionsIndexAdapter;
* update the property.
*/
template< typename PropType = WPropSelection, typename PropIndexAdapter = WGEShaderPropertyDefineOptionsIndexAdapter< PropType > >
class WGE_EXPORT WGEShaderPropertyDefineOptions: public WGEShaderDefineOptions
class WGEShaderPropertyDefineOptions: public WGEShaderDefineOptions
{
public:
......
......@@ -37,7 +37,13 @@
#include "../../../graphicsEngine/WGECamera.h"
#include "../../../graphicsEngine/WGEViewer.h"
class WColor;
namespace osg
{
class Vec4f;
typedef Vec4f Vec4;
}
typedef osg::Vec4 WColor;
/**
* A widget containing an open gl display area. This initializes OpenGL context and adds a view to the
......
......@@ -40,6 +40,7 @@
#include "../../graphicsEngine/WGEGeodeUtils.h"
#include "../../graphicsEngine/WGEManagedGroupNode.h"
#include "../../graphicsEngine/WGEUtils.h"
#include "../../graphicsEngine/WGETextureUtils.h"
#include "../../graphicsEngine/shaders/WGEPropertyUniform.h"
#include "../../graphicsEngine/shaders/WGEShader.h"
#include "../../graphicsEngine/shaders/WGEShaderDefineOptions.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment