Commit 8beb8280 authored by Artur Grunau's avatar Artur Grunau
Browse files

Build TGT as a shared library by default

This commit explicitly marks TGT to be built as a shared library and
adds several missing TGT_API annotations to TGT classes that are
required by other CAMPVIS modules.
parent d9e7da62
...@@ -92,6 +92,7 @@ IF(WIN32) ...@@ -92,6 +92,7 @@ IF(WIN32)
IF(CAMPVIS_SHARED_LIBS) IF(CAMPVIS_SHARED_LIBS)
# Linking against Windows DLLs requires explicit instantiation of templates # Linking against Windows DLLs requires explicit instantiation of templates
LIST(APPEND CampvisGlobalDefinitions "-DDLL_TEMPLATE_INST") LIST(APPEND CampvisGlobalDefinitions "-DDLL_TEMPLATE_INST")
LIST(APPEND CampvisGlobalDefinitions "-DVRN_DYNAMIC_LIBS")
IF(NOT CAMPVIS_GENERATE_MANIFEST) IF(NOT CAMPVIS_GENERATE_MANIFEST)
# Do not embed manifest into binaries in debug mode (slows down incremental linking) # Do not embed manifest into binaries in debug mode (slows down incremental linking)
......
...@@ -90,7 +90,7 @@ ENDIF(TGT_WITH_QT) ...@@ -90,7 +90,7 @@ ENDIF(TGT_WITH_QT)
################################################################################ ################################################################################
# define library target # define library target
################################################################################ ################################################################################
ADD_LIBRARY(tgt ${TGT_SOURCES} ${TGT_HEADERS}) ADD_LIBRARY(tgt SHARED ${TGT_SOURCES} ${TGT_HEADERS})
ADD_DEFINITIONS(${CampvisGlobalDefinitions} ${CampvisModulesDefinitions} ${QT_DEFINITIONS}) ADD_DEFINITIONS(${CampvisGlobalDefinitions} ${CampvisModulesDefinitions} ${QT_DEFINITIONS})
IF(CAMPVIS_SHARED_LIBS AND MSVC) IF(CAMPVIS_SHARED_LIBS AND MSVC)
ADD_DEFINITIONS("-DTGT_BUILD_DLL") ADD_DEFINITIONS("-DTGT_BUILD_DLL")
......
...@@ -3,13 +3,14 @@ ...@@ -3,13 +3,14 @@
#include "tgt/exception.h" #include "tgt/exception.h"
#include "tgt/tgt_gl.h" #include "tgt/tgt_gl.h"
#include "tgt/types.h"
#include <set> #include <set>
namespace tgt { namespace tgt {
class VertexAttribute; class VertexAttribute;
class BufferObject { class TGT_API BufferObject {
public: public:
enum TargetType { enum TargetType {
ARRAY_BUFFER = GL_ARRAY_BUFFER, ARRAY_BUFFER = GL_ARRAY_BUFFER,
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "tgt/singleton.h" #include "tgt/singleton.h"
#include "tgt/glcanvas.h" #include "tgt/glcanvas.h"
#include "tgt/types.h"
#include <tbb/mutex.h> // TODO: TBB dependency in TGT is not that beautiful... #include <tbb/mutex.h> // TODO: TBB dependency in TGT is not that beautiful...
#include <map> #include <map>
#include <string> #include <string>
...@@ -15,7 +16,7 @@ namespace tgt { ...@@ -15,7 +16,7 @@ namespace tgt {
/** /**
* Manages multiple shared OpenGL contexts and offers methods to ensure that only one context is active at a time. * Manages multiple shared OpenGL contexts and offers methods to ensure that only one context is active at a time.
*/ */
class GlContextManager : public Singleton<GlContextManager> { class TGT_API GlContextManager : public Singleton<GlContextManager> {
public: public:
/** /**
* Creates a new QtGLContext for the OpenGL context of \a canvas. * Creates a new QtGLContext for the OpenGL context of \a canvas.
...@@ -123,7 +124,7 @@ namespace tgt { ...@@ -123,7 +124,7 @@ namespace tgt {
static GlContextManager* singletonClass_; static GlContextManager* singletonClass_;
}; };
/** /**
* Scoped lockAndAcquire for a GLContext, that automatically unlocks the context on destruction. * Scoped lockAndAcquire for a GLContext, that automatically unlocks the context on destruction.
*/ */
......
...@@ -44,7 +44,7 @@ namespace tgt { ...@@ -44,7 +44,7 @@ namespace tgt {
around a given center (or, if you will, to rotate the camera around and focus it around a given center (or, if you will, to rotate the camera around and focus it
on that center while it is continuously moving on a sphere). on that center while it is continuously moving on a sphere).
*/ */
class Trackball : public Navigation { class TGT_API Trackball : public Navigation {
public: public:
/// Constructor /// Constructor
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "tgt/tgt_gl.h" #include "tgt/tgt_gl.h"
#include "tgt/singleton.h" #include "tgt/singleton.h"
#include "tgt/types.h"
#include <tbb/atomic.h> #include <tbb/atomic.h>
#include <tbb/concurrent_vector.h> #include <tbb/concurrent_vector.h>
#include <tbb/spin_mutex.h> #include <tbb/spin_mutex.h>
...@@ -45,7 +46,7 @@ namespace tgt { ...@@ -45,7 +46,7 @@ namespace tgt {
* *
* This class is to be considered as thread-safe. * This class is to be considered as thread-safe.
*/ */
class OpenGLGarbageCollector : public Singleton<OpenGLGarbageCollector> { class TGT_API OpenGLGarbageCollector : public Singleton<OpenGLGarbageCollector> {
friend class Singleton<OpenGLGarbageCollector>; friend class Singleton<OpenGLGarbageCollector>;
public: public:
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#define TGT_QTCANVAS_H #define TGT_QTCANVAS_H
#include "tgt/glcanvas.h" #include "tgt/glcanvas.h"
#include "tgt/types.h"
#include <QGLWidget> #include <QGLWidget>
#include <QGLFormat> #include <QGLFormat>
...@@ -39,7 +40,7 @@ namespace tgt { ...@@ -39,7 +40,7 @@ namespace tgt {
/** /**
* Qt implementation of GLCanvas. Inherits QGLWidget and combines the Qt methods and tgt methods. * Qt implementation of GLCanvas. Inherits QGLWidget and combines the Qt methods and tgt methods.
*/ */
class QtCanvas : public GLCanvas, public QGLWidget { class TGT_API QtCanvas : public GLCanvas, public QGLWidget {
public: public:
/** /**
* The constructor. Allows the user to specify a shared widget that this canvas will share * The constructor. Allows the user to specify a shared widget that this canvas will share
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "tgt/singleton.h" #include "tgt/singleton.h"
#include "tgt/glcontextmanager.h" #include "tgt/glcontextmanager.h"
#include "tgt/qt/qtthreadedcanvas.h" #include "tgt/qt/qtthreadedcanvas.h"
#include "tgt/types.h"
#include <tbb/mutex.h> // TODO: TBB dependency in TGT is not that beautiful... #include <tbb/mutex.h> // TODO: TBB dependency in TGT is not that beautiful...
#include <map> #include <map>
#include <string> #include <string>
...@@ -16,7 +17,7 @@ namespace tgt { ...@@ -16,7 +17,7 @@ namespace tgt {
* Manages multiple shared OpenGL contexts and offers methods to ensure that only one context is active at a time. * Manages multiple shared OpenGL contexts and offers methods to ensure that only one context is active at a time.
* *
*/ */
class QtContextManager : public GlContextManager { class TGT_API QtContextManager : public GlContextManager {
public: public:
/** /**
* Creates a new QtGLContext for the OpenGL context of \a canvas. * Creates a new QtGLContext for the OpenGL context of \a canvas.
......
...@@ -2,13 +2,14 @@ ...@@ -2,13 +2,14 @@
#define QTTHREADEDCANVAS_H__ #define QTTHREADEDCANVAS_H__
#include "tgt/qt/qtcanvas.h" #include "tgt/qt/qtcanvas.h"
#include "tgt/types.h"
namespace tgt { namespace tgt {
/** /**
* Subclass of QtCanvas that supports multi-threading. * Subclass of QtCanvas that supports multi-threading.
*/ */
class QtThreadedCanvas : public tgt::QtCanvas { class TGT_API QtThreadedCanvas : public tgt::QtCanvas {
public: public:
QtThreadedCanvas( QtThreadedCanvas(
const std::string& title = "", const std::string& title = "",
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "tgt/exception.h" #include "tgt/exception.h"
#include "tgt/tgt_gl.h" #include "tgt/tgt_gl.h"
#include "tgt/types.h"
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -20,7 +21,7 @@ namespace tgt { ...@@ -20,7 +21,7 @@ namespace tgt {
* \note Because all member methods require a valid locked OpenGL context, we have * \note Because all member methods require a valid locked OpenGL context, we have
* implicit thread-safety. * implicit thread-safety.
*/ */
class VertexArrayObject { class TGT_API VertexArrayObject {
public: public:
VertexArrayObject(bool autoBind = true) throw (tgt::Exception); VertexArrayObject(bool autoBind = true) throw (tgt::Exception);
......
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