Skip to content

Commit 8305656

Browse files
committed
Don't use GLEW in Fireworks
The Frame Buffer Object (FBO) feature is part of OpenGL since version 3.0 from 2008. Nowadays, we can therefore assume that this feature is always available. That means we don't have to use GLEW to check whether this feature is present. Like that, we can avoid using GLEW entirely, which is an implementation detail of OpenGL loading in ROOT that will soon go away. To make sure GLEW is not included anymore, this commit replaces includes of `TGLIncludes.h` with the OpenGL headers only, because `TGLIncludes.h` was including OpenGL plus GLEW. See also: * root-project/root#18471 * root-project/root#20294 (comment)
1 parent c7a91a3 commit 8305656

File tree

8 files changed

+31
-22
lines changed

8 files changed

+31
-22
lines changed

Fireworks/Core/src/CmsAnnotation.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#include <sstream>
22
#include <cmath>
33

4-
#include "TGLIncludes.h"
4+
#include <GL/gl.h>
5+
#include <GL/glu.h>
6+
57
#include "TGLCamera.h"
68
#include "TGLRnrCtx.h"
79
#include "TGLSelectRecord.h"

Fireworks/Core/src/FWEveDigitSetScalableMarker.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#include "TGLIncludes.h"
1+
#include <GL/gl.h>
2+
#include <GL/glu.h>
3+
24
#include "Fireworks/Core/src/FWEveDigitSetScalableMarker.h"
35

46
void FWEveDigitSetScalableMarkerGL::DirectDraw(TGLRnrCtx& rnrCtx) const {

Fireworks/Core/src/FWGUIManager.cc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
#include <thread>
1818
#include <future>
1919

20+
#include <GL/gl.h>
21+
#include <GL/glu.h>
22+
2023
#include "TGButton.h"
2124
#include "TGLabel.h"
2225
#include "TSystem.h"
23-
#include "TGLIncludes.h"
2426
#include "TGLViewer.h"
2527
#include "TEveBrowser.h"
2628
#include "TEveManager.h"
@@ -849,16 +851,14 @@ void FWGUIManager::exportAllViews(const std::string& format, int height) {
849851
TString file;
850852
file.Form(format.c_str(), event->id().run(), event->id().event(), event->luminosityBlock(), view_name.Data());
851853

852-
if (GLEW_EXT_framebuffer_object) {
853-
// Multi-threaded save
854-
futures.push_back((*j)->CaptureAndSaveImage(file, height));
855-
} else {
856-
// Single-threaded save
857-
if (height == -1)
858-
(*j)->GetGLViewer()->SavePicture(file);
859-
else
860-
(*j)->GetGLViewer()->SavePictureHeight(file, height);
861-
}
854+
// Multi-threaded save
855+
futures.push_back((*j)->CaptureAndSaveImage(file, height));
856+
857+
// Single-threaded save
858+
// if (height == -1)
859+
// (*j)->GetGLViewer()->SavePicture(file);
860+
// else
861+
// (*j)->GetGLViewer()->SavePictureHeight(file, height);
862862
}
863863
}
864864

Fireworks/Core/src/FWGeoTopNodeGL.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#include "Fireworks/Core/src/FWGeoTopNodeGL.h"
22
#include "Fireworks/Core/interface/FWGeoTopNode.h"
33

4-
#include "TGLIncludes.h"
4+
#include <GL/gl.h>
5+
#include <GL/glu.h>
6+
57
#include "TGLRnrCtx.h"
68
#include "TGLViewer.h"
79

Fireworks/Core/src/FWTEveViewer.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
// user include files
1919

2020
#include "TMath.h"
21-
#include "TGLIncludes.h"
2221
#include "TGLFBO.h"
2322

23+
#include <GL/gl.h>
24+
#include <GL/glu.h>
25+
2426
#include "Fireworks/Core/interface/FWTEveViewer.h"
2527
#include "Fireworks/Core/interface/FWTGLViewer.h"
2628

Fireworks/Core/src/FWTGLViewer.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
#include "TMath.h"
2020

21-
#include "TGLIncludes.h"
21+
#include <GL/gl.h>
22+
#include <GL/glu.h>
23+
2224
#include "TGLFBO.h"
2325
#include "TGLWidget.h"
2426

@@ -142,10 +144,6 @@ TGLFBO* FWTGLViewer::GenerateFbo(Int_t w, Int_t h, Float_t pixel_object_scale) {
142144

143145
static const TString eh("FWTGLViewer::SavePictureUsingFBO");
144146

145-
if (!GLEW_EXT_framebuffer_object) {
146-
::Warning(eh, "Missing FBO support.");
147-
}
148-
149147
if (!TakeLock(kDrawLock)) {
150148
::Error(eh, "viewer locked - try later.");
151149
return nullptr;

Fireworks/Core/src/FWTextProjected.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
#include "TEveTrans.h"
2121
#include "TGLBoundingBox.h"
2222

23-
#include "TGLIncludes.h"
23+
#include <GL/gl.h>
24+
#include <GL/glu.h>
2425

2526
#include "TGLRnrCtx.h"
2627
#include "TGLUtil.h"

Fireworks/Vertices/src/TEveEllipsoidGL.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
#include "TMatrixDSym.h"
1515

1616
#include "TDecompSVD.h"
17-
#include "TGLIncludes.h"
17+
18+
#include <GL/gl.h>
19+
#include <GL/glu.h>
1820

1921
//==============================================================================
2022
// TEveEllipsoidGL

0 commit comments

Comments
 (0)