Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
f2c50ddc
Commit
f2c50ddc
authored
11 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
fixes to background image
parent
f26864a8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/DefaultOptions.h
+2
-2
2 additions, 2 deletions
Common/DefaultOptions.h
Graphics/drawContext.cpp
+4
-4
4 additions, 4 deletions
Graphics/drawContext.cpp
with
6 additions
and
6 deletions
Common/DefaultOptions.h
+
2
−
2
View file @
f2c50ddc
...
@@ -339,9 +339,9 @@ StringXNumber GeneralOptions_Number[] = {
...
@@ -339,9 +339,9 @@ StringXNumber GeneralOptions_Number[] = {
"Y position of background image (for 2D background: < 0: measure from bottom edge; "
"Y position of background image (for 2D background: < 0: measure from bottom edge; "
">= 1e5: centered)"
},
">= 1e5: centered)"
},
{
F
|
O
,
"BackgroundImageWidth"
,
opt_general_background_image_size0
,
-
1
.
,
{
F
|
O
,
"BackgroundImageWidth"
,
opt_general_background_image_size0
,
-
1
.
,
"Width of background image (0: actual width; -1:
fullscreen
)"
},
"Width of background image (0: actual width; -1:
graphic window width
)"
},
{
F
|
O
,
"BackgroundImageHeight"
,
opt_general_background_image_size1
,
-
1
,
{
F
|
O
,
"BackgroundImageHeight"
,
opt_general_background_image_size1
,
-
1
,
"Height of background image (0: actual
width; -1: fullscreen
)"
},
"Height of background image (0: actual
height; -1: graphic window height
)"
},
{
F
|
O
,
"Camera"
,
opt_general_camera_mode
,
0
.
,
{
F
|
O
,
"Camera"
,
opt_general_camera_mode
,
0
.
,
"Enable camera view mode"
},
"Enable camera view mode"
},
...
...
This diff is collapsed.
Click to expand it.
Graphics/drawContext.cpp
+
4
−
4
View file @
f2c50ddc
...
@@ -416,8 +416,8 @@ void drawContext::drawBackgroundImage(bool threeD)
...
@@ -416,8 +416,8 @@ void drawContext::drawBackgroundImage(bool threeD)
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGBA
,
img2
->
w
(),
img2
->
h
(),
0
,
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGBA
,
img2
->
w
(),
img2
->
h
(),
0
,
(
img2
->
d
()
==
4
)
?
GL_RGBA
:
GL_RGB
,
(
img2
->
d
()
==
4
)
?
GL_RGBA
:
GL_RGB
,
GL_UNSIGNED_BYTE
,
img2
->
array
);
GL_UNSIGNED_BYTE
,
img2
->
array
);
_bgImageW
=
img
2
->
w
();
_bgImageW
=
img
->
w
();
_bgImageH
=
img
2
->
h
();
_bgImageH
=
img
->
h
();
delete
img
;
delete
img
;
delete
img2
;
delete
img2
;
}
}
...
@@ -461,8 +461,8 @@ void drawContext::drawBackgroundImage(bool threeD)
...
@@ -461,8 +461,8 @@ void drawContext::drawBackgroundImage(bool threeD)
}
}
else
{
else
{
int
c
=
fix2dCoordinates
(
&
x
,
&
y
);
// y=0 now means top
int
c
=
fix2dCoordinates
(
&
x
,
&
y
);
// y=0 now means top
if
(
c
&
1
)
x
-=
_bgImageW
/
2.
;
if
(
c
&
1
)
x
-=
w
/
2.
;
if
(
c
&
2
)
y
+=
_bgImageH
/
2.
;
if
(
c
&
2
)
y
+=
h
/
2.
;
if
(
x
<
viewport
[
0
])
x
=
viewport
[
0
];
if
(
x
<
viewport
[
0
])
x
=
viewport
[
0
];
if
(
y
<
viewport
[
1
])
y
=
viewport
[
1
];
if
(
y
<
viewport
[
1
])
y
=
viewport
[
1
];
glTexCoord2f
(
1.0
f
,
1.0
f
);
glVertex2d
(
x
+
w
,
y
-
h
);
glTexCoord2f
(
1.0
f
,
1.0
f
);
glVertex2d
(
x
+
w
,
y
-
h
);
...
...
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