Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
glfw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pirvi-public
glfw
Commits
a5281df5
Commit
a5281df5
authored
10 years ago
by
Camilla Löwy
Browse files
Options
Downloads
Patches
Plain Diff
Moved RandR gamma probe to init.
parent
59d1aa52
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/x11_init.c
+17
-1
17 additions, 1 deletion
src/x11_init.c
src/x11_monitor.c
+0
-23
0 additions, 23 deletions
src/x11_monitor.c
with
17 additions
and
24 deletions
src/x11_init.c
+
17
−
1
View file @
a5281df5
...
@@ -475,6 +475,8 @@ static GLboolean initExtensions(void)
...
@@ -475,6 +475,8 @@ static GLboolean initExtensions(void)
if
(
_glfw
.
x11
.
randr
.
available
)
if
(
_glfw
.
x11
.
randr
.
available
)
{
{
XRRScreenResources
*
sr
;
if
(
!
XRRQueryVersion
(
_glfw
.
x11
.
display
,
if
(
!
XRRQueryVersion
(
_glfw
.
x11
.
display
,
&
_glfw
.
x11
.
randr
.
versionMajor
,
&
_glfw
.
x11
.
randr
.
versionMajor
,
&
_glfw
.
x11
.
randr
.
versionMinor
))
&
_glfw
.
x11
.
randr
.
versionMinor
))
...
@@ -490,6 +492,21 @@ static GLboolean initExtensions(void)
...
@@ -490,6 +492,21 @@ static GLboolean initExtensions(void)
{
{
_glfw
.
x11
.
randr
.
available
=
GL_FALSE
;
_glfw
.
x11
.
randr
.
available
=
GL_FALSE
;
}
}
sr
=
XRRGetScreenResources
(
_glfw
.
x11
.
display
,
_glfw
.
x11
.
root
);
if
(
!
sr
->
ncrtc
||
!
XRRGetCrtcGammaSize
(
_glfw
.
x11
.
display
,
sr
->
crtcs
[
0
]))
{
// This is either a headless system or an older Nvidia binary driver
// with broken gamma support
// Flag it as useless and fall back to Xf86VidMode gamma, if
// available
_glfwInputError
(
GLFW_PLATFORM_ERROR
,
"X11: RandR gamma ramp support seems broken"
);
_glfw
.
x11
.
randr
.
gammaBroken
=
GL_TRUE
;
}
XRRFreeScreenResources
(
sr
);
}
}
if
(
XQueryExtension
(
_glfw
.
x11
.
display
,
if
(
XQueryExtension
(
_glfw
.
x11
.
display
,
...
@@ -701,7 +718,6 @@ int _glfwPlatformInit(void)
...
@@ -701,7 +718,6 @@ int _glfwPlatformInit(void)
_glfwInitTimer
();
_glfwInitTimer
();
_glfwInitJoysticks
();
_glfwInitJoysticks
();
_glfwInitGammaRamp
();
return
GL_TRUE
;
return
GL_TRUE
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/x11_monitor.c
+
0
−
23
View file @
a5281df5
...
@@ -95,29 +95,6 @@ static GLFWvidmode vidmodeFromModeInfo(const XRRModeInfo* mi,
...
@@ -95,29 +95,6 @@ static GLFWvidmode vidmodeFromModeInfo(const XRRModeInfo* mi,
////// GLFW internal API //////
////// GLFW internal API //////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// Detect gamma ramp support
//
void
_glfwInitGammaRamp
(
void
)
{
if
(
_glfw
.
x11
.
randr
.
available
)
{
XRRScreenResources
*
sr
=
XRRGetScreenResources
(
_glfw
.
x11
.
display
,
_glfw
.
x11
.
root
);
if
(
!
sr
->
ncrtc
||
!
XRRGetCrtcGammaSize
(
_glfw
.
x11
.
display
,
sr
->
crtcs
[
0
]))
{
// This is either a headless system or an older Nvidia binary driver
// with broken gamma support
// Flag it as useless and fall back to Xf86VidMode, if available
_glfwInputError
(
GLFW_PLATFORM_ERROR
,
"X11: RandR gamma ramp support seems broken"
);
_glfw
.
x11
.
randr
.
gammaBroken
=
GL_TRUE
;
}
XRRFreeScreenResources
(
sr
);
}
}
// Set the current video mode for the specified monitor
// Set the current video mode for the specified monitor
//
//
GLboolean
_glfwSetVideoMode
(
_GLFWmonitor
*
monitor
,
const
GLFWvidmode
*
desired
)
GLboolean
_glfwSetVideoMode
(
_GLFWmonitor
*
monitor
,
const
GLFWvidmode
*
desired
)
...
...
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