Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libsimple_graphical
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
We are moving to Forgejo!
You are on a read-only GitLab instance.
Show more breadcrumbs
namark
libsimple_graphical
Commits
225ca8ad
Commit
225ca8ad
authored
6 years ago
by
namark
Browse files
Options
Downloads
Patches
Plain Diff
Some accessors for window.
parent
7e30fc3f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/simple/graphical/window.cpp
+53
-12
53 additions, 12 deletions
source/simple/graphical/window.cpp
source/simple/graphical/window.h
+12
-0
12 additions, 0 deletions
source/simple/graphical/window.h
with
65 additions
and
12 deletions
source/simple/graphical/window.cpp
+
53
−
12
View file @
225ca8ad
...
...
@@ -7,18 +7,6 @@
namespace
simple
::
graphical
{
int2
window
::
size
()
const
noexcept
{
auto
result
=
-
int2
::
one
();
SDL_GetWindowSize
(
guts
().
get
(),
&
result
.
x
(),
&
result
.
y
());
return
result
;
}
void
window
::
size
(
int2
value
)
const
noexcept
{
SDL_SetWindowSize
(
guts
().
get
(),
value
.
x
(),
value
.
y
());
}
window
::
window
(
std
::
string
title
,
int2
size
,
flags
options
,
int2
position
)
:
sdl_window_wrapper
(
...
...
@@ -33,4 +21,57 @@ namespace simple::graphical
)
{}
int2
window
::
size
()
const
noexcept
{
auto
result
=
-
int2
::
one
();
SDL_GetWindowSize
(
guts
().
get
(),
&
result
.
x
(),
&
result
.
y
());
return
result
;
}
void
window
::
size
(
int2
value
)
const
noexcept
{
SDL_SetWindowSize
(
guts
().
get
(),
value
.
x
(),
value
.
y
());
}
int2
window
::
position
()
const
noexcept
{
auto
result
=
window
::
undefined_position
;
SDL_GetWindowPosition
(
guts
().
get
(),
&
result
.
x
(),
&
result
.
y
());
return
result
;
}
void
window
::
position
(
int2
value
)
const
noexcept
{
SDL_SetWindowPosition
(
guts
().
get
(),
value
.
x
(),
value
.
y
());
}
#if SDL_VERSION_ATLEAST(2,0,5)
float
window
::
opacity
()
const
noexcept
{
float
result
=
-
1
;
SDL_GetWindowOpacity
(
guts
().
get
(),
&
result
);
return
result
;
}
void
window
::
opacity
(
float
value
)
const
noexcept
{
SDL_SetWindowOpacity
(
guts
().
get
(),
value
);
}
#endif
void
window
::
show
()
const
noexcept
{
SDL_ShowWindow
(
guts
().
get
());
}
void
window
::
hide
()
const
noexcept
{
SDL_HideWindow
(
guts
().
get
());
}
void
window
::
minimize
()
const
noexcept
{
// SDL_PumpEvents();
SDL_MinimizeWindow
(
guts
().
get
());
}
void
window
::
restore
()
const
noexcept
{
// SDL_PumpEvents();
SDL_RestoreWindow
(
guts
().
get
());
}
}
// namespace simple::graphical
This diff is collapsed.
Click to expand it.
source/simple/graphical/window.h
+
12
−
0
View file @
225ca8ad
...
...
@@ -59,6 +59,18 @@ namespace simple::graphical
int2
size
()
const
noexcept
;
void
size
(
int2
value
)
const
noexcept
;
int2
position
()
const
noexcept
;
void
position
(
int2
value
)
const
noexcept
;
#if SDL_VERSION_ATLEAST(2,0,5)
float
opacity
()
const
noexcept
;
void
opacity
(
float
value
)
const
noexcept
;
#endif
void
show
()
const
noexcept
;
void
hide
()
const
noexcept
;
void
minimize
()
const
noexcept
;
void
restore
()
const
noexcept
;
protected
:
...
...
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