Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
trex
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
swp21_biotracker
trex
Commits
cc6d60e1
Commit
cc6d60e1
authored
4 years ago
by
Tristan Walter
Browse files
Options
Downloads
Plain Diff
Merge branch 'gl2' of
https://github.com/mooch443/trex
into gl2
parents
32976878
d6910c1a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Application/src/commons/common/gui/GLImpl.cpp
+15
-9
15 additions, 9 deletions
Application/src/commons/common/gui/GLImpl.cpp
with
15 additions
and
9 deletions
Application/src/commons/common/gui/GLImpl.cpp
+
15
−
9
View file @
cc6d60e1
...
@@ -53,6 +53,9 @@ using ImTextureID_t = ImGui_OpenGL2_TextureID;
...
@@ -53,6 +53,9 @@ using ImTextureID_t = ImGui_OpenGL2_TextureID;
#define GLIMPL_CHECK_THREAD_ID() check_thread_id( __LINE__ , __FILE__ )
#define GLIMPL_CHECK_THREAD_ID() check_thread_id( __LINE__ , __FILE__ )
namespace
gl
{
int
major
=
0
,
minor
=
0
;
}
//#include "misc/freetype/imgui_freetype.h"
//#include "misc/freetype/imgui_freetype.h"
//#include "misc/freetype/imgui_freetype.cpp"
//#include "misc/freetype/imgui_freetype.cpp"
...
@@ -74,11 +77,6 @@ void GLImpl::init() {
...
@@ -74,11 +77,6 @@ void GLImpl::init() {
draw_calls
=
0
;
draw_calls
=
0
;
_update_thread
=
std
::
this_thread
::
get_id
();
_update_thread
=
std
::
this_thread
::
get_id
();
if
OPENGL3_CONDITION
Debug
(
"Using OpenGL3.2 (seems supported)."
);
else
Debug
(
"Using OpenGL2.0"
);
}
}
void
GLImpl
::
post_init
()
{
void
GLImpl
::
post_init
()
{
...
@@ -122,17 +120,17 @@ void GLImpl::create_window(int width, int height) {
...
@@ -122,17 +120,17 @@ void GLImpl::create_window(int width, int height) {
// GL 3.2 + GLSL 150
// GL 3.2 + GLSL 150
const
char
*
glsl_version
=
"#version 150"
;
const
char
*
glsl_version
=
"#version 150"
;
if
OPENGL3_CONDITION
{
#if !CMN_USE_OPENGL2
glfwWindowHint
(
GLFW_CONTEXT_VERSION_MAJOR
,
3
);
glfwWindowHint
(
GLFW_CONTEXT_VERSION_MAJOR
,
3
);
glfwWindowHint
(
GLFW_CONTEXT_VERSION_MINOR
,
2
);
glfwWindowHint
(
GLFW_CONTEXT_VERSION_MINOR
,
2
);
glfwWindowHint
(
GLFW_OPENGL_PROFILE
,
GLFW_OPENGL_CORE_PROFILE
);
// 3.2+ only
glfwWindowHint
(
GLFW_OPENGL_PROFILE
,
GLFW_OPENGL_CORE_PROFILE
);
// 3.2+ only
glfwWindowHint
(
GLFW_OPENGL_FORWARD_COMPAT
,
GL_TRUE
);
// Required on Mac
glfwWindowHint
(
GLFW_OPENGL_FORWARD_COMPAT
,
GL_TRUE
);
// Required on Mac
#else
}
else
{
glfwWindowHint
(
GLFW_CONTEXT_VERSION_MAJOR
,
2
);
glfwWindowHint
(
GLFW_CONTEXT_VERSION_MAJOR
,
2
);
glfwWindowHint
(
GLFW_CONTEXT_VERSION_MINOR
,
0
);
glfwWindowHint
(
GLFW_CONTEXT_VERSION_MINOR
,
0
);
}
#endif
#else
#else
// GL 3.0 + GLSL 130
// GL 3.0 + GLSL 130
const
char
*
glsl_version
=
"#version 130"
;
const
char
*
glsl_version
=
"#version 130"
;
...
@@ -164,6 +162,14 @@ void GLImpl::create_window(int width, int height) {
...
@@ -164,6 +162,14 @@ void GLImpl::create_window(int width, int height) {
U_EXCEPTION
(
"Failed to initialize OpenGL loader!"
);
U_EXCEPTION
(
"Failed to initialize OpenGL loader!"
);
}
}
glGetIntegerv
(
GL_MAJOR_VERSION
,
&
gl
::
major
);
glGetIntegerv
(
GL_MINOR_VERSION
,
&
gl
::
minor
);
if
OPENGL3_CONDITION
Debug
(
"Using OpenGL3.2 (seems supported, %d.%d %s)."
,
gl
::
major
,
gl
::
minor
,
glGetString
(
GL_VERSION
));
else
Debug
(
"Using OpenGL2.0 (%d.%d) %s"
,
gl
::
major
,
gl
::
minor
,
glGetString
(
GL_VERSION
));
IMGUI_CHECKVERSION
();
IMGUI_CHECKVERSION
();
ImGui
::
CreateContext
();
ImGui
::
CreateContext
();
ImGuiIO
&
io
=
ImGui
::
GetIO
();
(
void
)
io
;
ImGuiIO
&
io
=
ImGui
::
GetIO
();
(
void
)
io
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment