Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
netrunner
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Sharinigma
netrunner
Commits
84a32611
Commit
84a32611
authored
7 years ago
by
Odilitime
Browse files
Options
Downloads
Patches
Plain Diff
new resize prototype, boundToPage, indices, onMouseDown/onMouseUp/onFocus/onBlur
parent
ee08b50a
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
src/graphics/components/Component.h
+18
-2
18 additions, 2 deletions
src/graphics/components/Component.h
with
18 additions
and
2 deletions
src/graphics/components/Component.h
+
18
−
2
View file @
84a32611
...
...
@@ -12,6 +12,9 @@ struct rgba {
unsigned
int
a
;
};
// should have 2 classes after this
// non-rendererable component (wtf are these?)
// and renderable component
class
Component
{
public:
virtual
~
Component
();
...
...
@@ -30,8 +33,12 @@ public:
// since we update the window size before resize, why just not pass it
// well no need to pass it if it's just a window* and then we'd already have it
// but we may hang onto the variables to know what the state is set up for
virtual
void
resize
();
// why pass it here? on resize we call layout no this...
virtual
void
resize
(
const
int
passedWindowWidth
,
const
int
passedWindowHeight
);
void
pointToViewport
(
float
&
rawX
,
float
&
rawY
)
const
;
void
distanceToViewport
(
float
&
rawX
,
float
&
rawY
)
const
;
// HELP I'M LOOKING FOR YOUR OPINION
// a ptr to window would be less memory
// but it would increase Component's depenedencies
...
...
@@ -46,7 +53,11 @@ public:
*/
int
windowWidth
;
int
windowHeight
;
bool
boundToPage
=
true
;
const
unsigned
int
indices
[
6
]
=
{
0
,
1
,
2
,
0
,
2
,
3
};
bool
verticesDirty
=
false
;
std
::
shared_ptr
<
Component
>
parent
=
nullptr
;
std
::
shared_ptr
<
Component
>
previous
=
nullptr
;
...
...
@@ -93,7 +104,12 @@ public:
bool
isVisibile
=
true
;
bool
isInline
=
false
;
// text-only thing but there maybe other non-text inline
bool
textureSetup
=
false
;
// probably shoudl be vector (or maybe use the event emitter)
std
::
function
<
void
(
int
x
,
int
y
)
>
onMousedown
=
nullptr
;
std
::
function
<
void
(
int
x
,
int
y
)
>
onMouseup
=
nullptr
;
std
::
function
<
void
()
>
onClick
=
nullptr
;
std
::
function
<
void
()
>
onFocus
=
nullptr
;
std
::
function
<
void
()
>
onBlur
=
nullptr
;
};
#endif
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