Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
FIG Project
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
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
Show more breadcrumbs
BATON Theau
FIG Project
Commits
d2bba1be
Commit
d2bba1be
authored
7 months ago
by
BATON Theau
Browse files
Options
Downloads
Patches
Plain Diff
Avoid binding of fbo for empty layers
parent
112e3c42
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
source/engine/graphics/front/engine/Engine.cpp
+3
-1
3 additions, 1 deletion
source/engine/graphics/front/engine/Engine.cpp
source/engine/graphics/front/engine/Layer.hpp
+2
-0
2 additions, 0 deletions
source/engine/graphics/front/engine/Layer.hpp
source/main.cpp
+50
-1
50 additions, 1 deletion
source/main.cpp
with
55 additions
and
2 deletions
source/engine/graphics/front/engine/Engine.cpp
+
3
−
1
View file @
d2bba1be
...
@@ -22,8 +22,10 @@ namespace megu {
...
@@ -22,8 +22,10 @@ namespace megu {
// Draw Layers
// Draw Layers
TextureArray
textures
;
TextureArray
textures
;
for
(
auto
&
[
priority
,
layer
]
:
this
->
_layers
)
{
for
(
auto
&
[
priority
,
layer
]
:
this
->
_layers
)
{
if
(
!
layer
.
get
()
->
empty
())
{
textures
.
push_back
(
layer
->
draw
(
this
->
_window
,
textures
));
textures
.
push_back
(
layer
->
draw
(
this
->
_window
,
textures
));
}
}
}
// Merge Textures
// Merge Textures
FrameBuffer
::
BindDefaultFrameBuffer
();
FrameBuffer
::
BindDefaultFrameBuffer
();
...
...
This diff is collapsed.
Click to expand it.
source/engine/graphics/front/engine/Layer.hpp
+
2
−
0
View file @
d2bba1be
...
@@ -16,6 +16,8 @@ namespace megu {
...
@@ -16,6 +16,8 @@ namespace megu {
void
push
(
Priority
,
const
DrawGroup
&
);
void
push
(
Priority
,
const
DrawGroup
&
);
inline
bool
empty
()
const
{
return
this
->
_objects
.
empty
();}
virtual
const
Texture
&
draw
(
const
Window
&
,
const
TextureArray
&
)
const
;
virtual
const
Texture
&
draw
(
const
Window
&
,
const
TextureArray
&
)
const
;
private
:
private
:
...
...
This diff is collapsed.
Click to expand it.
source/main.cpp
+
50
−
1
View file @
d2bba1be
...
@@ -42,6 +42,7 @@ int main(int argc, const char * argv[]) {
...
@@ -42,6 +42,7 @@ int main(int argc, const char * argv[]) {
//? Group
//? Group
megu
::
ImageGroup
group
;
megu
::
ImageGroup
group
;
megu
::
ImageGroup
group_2
;
megu
::
ImageGroup
group_2
;
megu
::
ImageGroup
group_3
;
std
::
cout
<<
"Group Inited"
<<
std
::
endl
;
std
::
cout
<<
"Group Inited"
<<
std
::
endl
;
...
@@ -94,7 +95,7 @@ int main(int argc, const char * argv[]) {
...
@@ -94,7 +95,7 @@ int main(int argc, const char * argv[]) {
std
::
cout
<<
"Image Inited 1"
<<
std
::
endl
;
std
::
cout
<<
"Image Inited 1"
<<
std
::
endl
;
//? Image
1
//? Image
2
std
::
vector
<
int
>
map_2
=
{
std
::
vector
<
int
>
map_2
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
...
@@ -138,6 +139,52 @@ int main(int argc, const char * argv[]) {
...
@@ -138,6 +139,52 @@ int main(int argc, const char * argv[]) {
i
.
get
()
->
setSize
({
32.
f
,
32.
f
});
i
.
get
()
->
setSize
({
32.
f
,
32.
f
});
}
}
std
::
cout
<<
"Image Inited 3"
<<
std
::
endl
;
//? Image 2
std
::
vector
<
int
>
map_3
=
{
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
};
size_t
x_3
=
0
;
size_t
y_3
=
0
;
std
::
vector
<
std
::
unique_ptr
<
megu
::
Image
>>
images_3
;
megu
::
Texture
texture_4
;
texture_4
.
store
(
megu
::
TextureBuffer
(
"assets/textures/Cube_Green.png"
));
for
(
auto
id
:
map_3
)
{
if
(
x_3
==
10
)
{
x_3
=
0
;
++
y_3
;
}
if
(
id
!=
0
)
{
images_3
.
push_back
(
std
::
make_unique
<
megu
::
Image
>
(
texture_4
));
glm
::
vec2
pos
=
to_screen_coordinate
({
x_3
,
y_3
},
32.
f
,
32.
f
,
2.
f
);
images_3
.
back
()
->
setPosition
({
pos
.
x
+
25
,
pos
.
y
});
}
++
x_3
;
}
for
(
auto
&
i
:
images_3
)
{
group_3
.
add
(
*
i
);
i
.
get
()
->
setSize
({
32.
f
,
32.
f
});
}
std
::
cout
<<
"Image Inited 2"
<<
std
::
endl
;
std
::
cout
<<
"Image Inited 2"
<<
std
::
endl
;
//? ImGui
//? ImGui
...
@@ -151,7 +198,9 @@ int main(int argc, const char * argv[]) {
...
@@ -151,7 +198,9 @@ int main(int argc, const char * argv[]) {
engine
.
push
(
0
,
basic_renderer
);
engine
.
push
(
0
,
basic_renderer
);
engine
.
push
(
1
,
basic_renderer
);
engine
.
push
(
1
,
basic_renderer
);
engine
.
push
(
2
,
basic_renderer
);
engine
.
push
(
1
,
1
,
group_3
);
engine
.
push
(
1
,
0
,
group
);
engine
.
push
(
1
,
0
,
group
);
engine
.
push
(
0
,
0
,
group_2
);
engine
.
push
(
0
,
0
,
group_2
);
...
...
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