diff --git a/src/add-ons/Jamfile b/src/add-ons/Jamfile index dce2670576..55d4e0d610 100644 --- a/src/add-ons/Jamfile +++ b/src/add-ons/Jamfile @@ -1,13 +1,14 @@ SubDir HAIKU_TOP src add-ons ; SubInclude HAIKU_TOP src add-ons accelerants ; +SubInclude HAIKU_TOP src add-ons decorators ; SubInclude HAIKU_TOP src add-ons input_server ; SubInclude HAIKU_TOP src add-ons kernel ; SubInclude HAIKU_TOP src add-ons mail_daemon ; SubInclude HAIKU_TOP src add-ons media ; +SubInclude HAIKU_TOP src add-ons opengl ; SubInclude HAIKU_TOP src add-ons print ; -SubInclude HAIKU_TOP src add-ons translators ; -SubInclude HAIKU_TOP src add-ons decorators ; -SubInclude HAIKU_TOP src add-ons tracker ; SubInclude HAIKU_TOP src add-ons screen_savers ; +SubInclude HAIKU_TOP src add-ons translators ; +SubInclude HAIKU_TOP src add-ons tracker ; diff --git a/src/add-ons/opengl/Jamfile b/src/add-ons/opengl/Jamfile new file mode 100644 index 0000000000..2dd9dda811 --- /dev/null +++ b/src/add-ons/opengl/Jamfile @@ -0,0 +1,4 @@ +SubDir HAIKU_TOP src add-ons opengl ; + +SubInclude HAIKU_TOP src add-ons opengl mesa ; + diff --git a/src/add-ons/opengl/mesa/Jamfile b/src/add-ons/opengl/mesa/Jamfile new file mode 100644 index 0000000000..8d597a030b --- /dev/null +++ b/src/add-ons/opengl/mesa/Jamfile @@ -0,0 +1,21 @@ +SubDir HAIKU_TOP src add-ons opengl mesa ; + +SetSubDirSupportedPlatformsBeOSCompatible ; + +if $(TARGET_PLATFORM) != haiku { + UseHeaders [ FDirName $(HAIKU_TOP) headers os opengl ] : true ; + # We need our public GL headers also when not compiling for Haiku. +} + + +UsePrivateHeaders opengl ; + +UseHeaders [ FDirName $(HAIKU_TOP) src kits opengl mesa ] ; +UseHeaders [ FDirName $(HAIKU_TOP) src kits opengl mesa main ] ; +UseHeaders [ FDirName $(HAIKU_TOP) src kits opengl mesa glapi ] ; + +Addon mesa_soft : opengl : + MesaRenderer.cpp + : false + : libmesa.a libGL.so be +; diff --git a/src/kits/opengl/mesa/MesaRenderer.cpp b/src/add-ons/opengl/mesa/MesaRenderer.cpp similarity index 94% rename from src/kits/opengl/mesa/MesaRenderer.cpp rename to src/add-ons/opengl/mesa/MesaRenderer.cpp index 15a869b096..1f13b84506 100644 --- a/src/kits/opengl/mesa/MesaRenderer.cpp +++ b/src/add-ons/opengl/mesa/MesaRenderer.cpp @@ -13,6 +13,13 @@ extern const char * color_space_name(color_space space); +extern "C" _EXPORT BGLRenderer * +instanciate_gl_renderer(BGLView *view, BGLDispatcher *dispatcher) +{ + return new MesaRenderer(view, 0, dispatcher); +} + + MesaRenderer::MesaRenderer(BGLView *view, ulong bgl_options, BGLDispatcher *dispatcher) : BGLRenderer(view, bgl_options, dispatcher), fBitmap(NULL), diff --git a/src/kits/opengl/mesa/MesaRenderer.h b/src/add-ons/opengl/mesa/MesaRenderer.h similarity index 100% rename from src/kits/opengl/mesa/MesaRenderer.h rename to src/add-ons/opengl/mesa/MesaRenderer.h diff --git a/src/kits/opengl/GLRenderer.cpp b/src/kits/opengl/GLRenderer.cpp index 6989fbc408..9d3457fb07 100644 --- a/src/kits/opengl/GLRenderer.cpp +++ b/src/kits/opengl/GLRenderer.cpp @@ -6,6 +6,7 @@ #include "GLRenderer.h" BGLRenderer::BGLRenderer(BGLView *view, ulong bgl_options, BGLDispatcher *dispatcher) + : fRefCount(1) { } @@ -15,6 +16,7 @@ BGLRenderer::~BGLRenderer() { } + void BGLRenderer::Acquire() { @@ -22,7 +24,7 @@ BGLRenderer::Acquire() } -void +void BGLRenderer::Release() { if (atomic_add(&fRefCount, -1) < 1) @@ -109,3 +111,10 @@ BGLRenderer::EnableDirectMode(bool enabled) { } + +status_t BGLRenderer::_Reserved_Renderer_0(int32 n, void *p) { return B_ERROR; } +status_t BGLRenderer::_Reserved_Renderer_1(int32 n, void *p) { return B_ERROR; } +status_t BGLRenderer::_Reserved_Renderer_2(int32 n, void *p) { return B_ERROR; } +status_t BGLRenderer::_Reserved_Renderer_3(int32 n, void *p) { return B_ERROR; } +status_t BGLRenderer::_Reserved_Renderer_4(int32 n, void *p) { return B_ERROR; } + diff --git a/src/kits/opengl/Jamfile b/src/kits/opengl/Jamfile index 9eb12509b7..66aababc9c 100644 --- a/src/kits/opengl/Jamfile +++ b/src/kits/opengl/Jamfile @@ -35,25 +35,16 @@ UseHeaders [ FDirName $(SUBDIR) mesa swrast_setup ] ; SubDirC++Flags $(defines) ; } -local arch_sources ; -if $(TARGET_ARCH) = x86 { - # On x86 platform, use the faster GL API dispatching assembly code! - arch_sources = glapi_x86.S ; -} else { - # For non-X86 platforms, no assembly code yet. - arch_sources = ; -} - -SEARCH_SOURCE += [ FDirName $(SUBDIR) mesa $(TARGET_ARCH) ] ; - SharedLibrary libGL.so : GLView.cpp GLDispatcher.cpp GLRenderer.cpp + : + # Mesa optimized GL dispatching code (if any) for this target architecture - $(arch_sources) - : + mesa_arch_$(TARGET_ARCH).o + # GLU API is included in libGL.so under BeOS R5, not a separate libglu.so library sgi-glu.o diff --git a/src/kits/opengl/mesa/Jamfile b/src/kits/opengl/mesa/Jamfile index 1b0b3809b3..18a01d37aa 100644 --- a/src/kits/opengl/mesa/Jamfile +++ b/src/kits/opengl/mesa/Jamfile @@ -9,7 +9,6 @@ if $(TARGET_PLATFORM) != haiku { UsePrivateHeaders opengl ; -UseHeaders [ FDirName $(SUBDIR) $(DOTDOT) ] ; UseHeaders [ FDirName $(SUBDIR) main ] ; UseHeaders [ FDirName $(SUBDIR) glapi ] ; UseHeaders [ FDirName $(SUBDIR) math ] ; @@ -248,8 +247,17 @@ StaticLibrary libmesa.a : glthread.c ; -Addon Mesa : opengl : - MesaRenderer.cpp - : false - : libmesa.a libGL.so be + +local arch_sources ; +if $(TARGET_ARCH) = x86 { + # On x86 platform, use the faster GL API dispatching assembly code! + arch_sources = glapi_x86.S ; +} else { + # For non-X86 platforms, no assembly code yet. + arch_sources = ; +} + +MergeObject mesa_arch_$(TARGET_ARCH).o : + $(arch_sources) ; +