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
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
Odilitime
netrunner
Commits
743b0676
Commit
743b0676
authored
7 years ago
by
Odilitime
Browse files
Options
Downloads
Patches
Plain Diff
relay keyUp event to documentComponent, fix log labels, remove window extern
parent
ba6cc240
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
src/graphics/components/MultiComponent.cpp
+13
-4
13 additions, 4 deletions
src/graphics/components/MultiComponent.cpp
src/graphics/components/MultiComponent.h
+1
-1
1 addition, 1 deletion
src/graphics/components/MultiComponent.h
with
14 additions
and
5 deletions
src/graphics/components/MultiComponent.cpp
+
13
−
4
View file @
743b0676
...
...
@@ -111,7 +111,16 @@ MultiComponent::MultiComponent(const float rawX, const float rawY, const float r
// should we mark win->renderDirty = true?
};
onKeyup
=
[
this
](
int
key
,
int
scancode
,
int
action
,
int
mods
)
{
//std::cout << "MultiComponent::MultiComponent:onKeyup" << std::endl;
//std::cout << "MultiComponent::MultiComponent:onKeyup - focused on " << typeOfComponent(this->focusedComponent) << std::endl;
DocumentComponent
*
docComponent
=
dynamic_cast
<
DocumentComponent
*>
(
this
->
focusedComponent
.
get
());
if
(
docComponent
)
{
if
(
action
==
0
)
{
if
(
docComponent
->
onKeyup
)
{
docComponent
->
onKeyup
(
key
,
scancode
,
action
,
mods
);
}
}
return
;
}
InputComponent
*
inputComponent
=
dynamic_cast
<
InputComponent
*>
(
this
->
focusedComponent
.
get
());
if
(
inputComponent
)
{
//std::cout << "inputComponent is focused, key pressed " << key << " action: " <<action << std::endl;
...
...
@@ -216,12 +225,12 @@ void MultiComponent::render() {
GLint
transformLocation
=
glGetUniformLocation
(
win
->
fontProgram
,
"transform"
);
GLenum
glErr
=
glGetError
();
if
(
glErr
!=
GL_NO_ERROR
)
{
std
::
cout
<<
"
Input
Component::render - glGetUniformLocation not ok: "
<<
glErr
<<
std
::
endl
;
std
::
cout
<<
"
Multi
Component::render - glGetUniformLocation not ok: "
<<
glErr
<<
std
::
endl
;
}
glUniformMatrix4fv
(
transformLocation
,
1
,
GL_FALSE
,
win
->
transformMatrix
);
glErr
=
glGetError
();
if
(
glErr
!=
GL_NO_ERROR
)
{
std
::
cout
<<
"
Input
Component::render - glUniformMatrix4fv not ok: "
<<
glErr
<<
std
::
endl
;
std
::
cout
<<
"
Multi
Component::render - glUniformMatrix4fv not ok: "
<<
glErr
<<
std
::
endl
;
}
}
renderComponents
(
rootComponent
);
...
...
@@ -294,7 +303,7 @@ void MultiComponent::renderBoxComponents(std::shared_ptr<Component> component) {
void
MultiComponent
::
renderComponentType
(
std
::
string
str
,
std
::
shared_ptr
<
Component
>
component
)
{
if
(
!
component
)
{
std
::
cout
<<
"
Window
::renderComponentType - got null passed"
<<
std
::
endl
;
std
::
cout
<<
"
MultiComponent
::renderComponentType - got null passed"
<<
std
::
endl
;
return
;
}
if
(
typeOfComponent
(
component
)
==
str
)
{
...
...
This diff is collapsed.
Click to expand it.
src/graphics/components/MultiComponent.h
+
1
−
1
View file @
743b0676
...
...
@@ -50,6 +50,6 @@ public:
double
cursorY
=
0
;
};
extern
const
std
::
unique_ptr
<
Window
>
window
;
//
extern const std::unique_ptr<Window> window;
#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