Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
vite
Commits
079ed283
Commit
079ed283
authored
11 years ago
by
Thibault Soucarre
Browse files
Options
Downloads
Patches
Plain Diff
Add selection rectangle. Alpha value isn't correct
parent
cf9cfd0f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/render/Render_alternate.cpp
+28
-1
28 additions, 1 deletion
src/render/Render_alternate.cpp
with
28 additions
and
1 deletion
src/render/Render_alternate.cpp
+
28
−
1
View file @
079ed283
...
@@ -245,6 +245,30 @@ void Render_alternate::paintGL(){
...
@@ -245,6 +245,30 @@ void Render_alternate::paintGL(){
//restore matrix
//restore matrix
_modelview
=
tmp
;
_modelview
=
tmp
;
}
}
/*draw selection if necessary*/
if
(
_mouse_pressed
&&
(
Info
::
Render
::
_key_ctrl
==
false
)
&&
!
_mouse_pressed_inside_container
){
Element_pos
x0
,
x1
,
y0
,
y1
;
x0
=
screen_to_render_x
(
_mouse_x
);
y0
=
/*Info::Render::height -*/
screen_to_render_y
(
_mouse_y
);
x1
=
screen_to_render_x
(
_new_mouse_x
);
y1
=
/*Info::Render::height -*/
screen_to_render_y
(
_new_mouse_y
);
float
selection
[
8
]
=
{
x0
,
y0
,
x0
,
y1
,
x1
,
y1
,
x1
,
y0
};
float
selection_colors
[
12
]
=
{
0.5
,
0.5
,
0.5
,
0.5
,
0.5
,
0.5
,
0.5
,
0.5
,
0.5
,
0.5
,
0.5
,
0.5
};
/*_modelview = glm::translate(_modelview, glm::vec3(_default_entity_x_translate - _x_state_translate,
_ruler_y + _ruler_height - _y_state_translate,
0));*/
//_modelview = glm::scale(_modelview, glm::vec3(_x_state_scale, _y_state_scale, 1));
glUniformMatrix4fv
(
glGetUniformLocation
(
_shader
.
getProgramID
(),
"modelview"
),
1
,
GL_FALSE
,
glm
::
value_ptr
(
_modelview
));
glUniformMatrix4fv
(
glGetUniformLocation
(
_shader
.
getProgramID
(),
"projection"
),
1
,
GL_FALSE
,
glm
::
value_ptr
(
_projection
));
glVertexAttribPointer
(
0
,
2
,
GL_FLOAT
,
GL_FALSE
,
0
,
selection
);
glEnableVertexAttribArray
(
0
);
glVertexAttribPointer
(
1
,
3
,
GL_FLOAT
,
GL_FALSE
,
0
,
selection_colors
);
glEnableVertexAttribArray
(
1
);
glDrawArrays
(
GL_QUADS
,
0
,
4
);
glDisableVertexAttribArray
(
0
);
glDisableVertexAttribArray
(
1
);
_modelview
=
tmp
;
}
// _containers.display(_modelview);
// _containers.display(_modelview);
//rendu
//rendu
...
@@ -347,7 +371,10 @@ void Render_alternate::paintGL(){
...
@@ -347,7 +371,10 @@ void Render_alternate::paintGL(){
buf_txt
.
str
().
c_str
(),
buf_txt
.
str
().
c_str
(),
arial_font
);
arial_font
);
}
}
// Render_alternate::QGLWidget::setFocus(Qt::ActiveWindowFocusReason);/* give the focus to the render area for mouse and keyboard events */
// Render_alternate::QGLWidget::setFocus(Qt::ActiveWindowFocusReason);/* give the focus to the render area for mouse and keyboard events */
...
...
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