Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
I
IMGRender
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
IMGRender
Commits
507026b6
Commit
507026b6
authored
Aug 02, 2022
by
Linshizhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Drawable.
parent
2cbc6266
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
Drawable.h
src/Drawable.h
+12
-0
canvas.cc
src/canvas.cc
+5
-0
canvas.h
src/canvas.h
+7
-1
No files found.
src/Drawable.h
0 → 100644
View file @
507026b6
#ifndef DRAWABLE_H
#define DRAWABLE_H
template
<
typename
T
>
class
Drawable
{
public
:
bool
draw
(
void
*
args
)
{
static_cast
<
T
*>
(
this
)
->
draw
(
args
);
}
};
#endif
/* DRAWABLE_H */
src/canvas.cc
View file @
507026b6
#include "canvas.h"
std
::
shared_ptr
<
Canvas
>
Canvas
::
MakeCanvas
(
int
width
,
int
height
,
PixelTypes
pixType
)
{
}
src/canvas.h
View file @
507026b6
#include <memory>
#include <memory>
#include "Drawable.h"
#ifndef CANVAS_H
#ifndef CANVAS_H
#define CANVAS_H
#define CANVAS_H
...
@@ -8,8 +9,13 @@ enum PixelTypes {};
...
@@ -8,8 +9,13 @@ enum PixelTypes {};
class
Canvas
{
class
Canvas
{
public
:
public
:
Canvas
(
int
width
,
int
height
,
PixelTypes
pixType
);
static
std
::
shared_ptr
<
Canvas
>
MakeCanvas
(
int
width
,
int
height
,
PixelTypes
pixType
);
template
<
typename
T
>
bool
draw
(
Drawable
<
T
>*
drawable
);
protected
:
Canvas
(
int
width
,
int
height
,
PixelTypes
pixType
);
};
};
#endif
/* CANVAS_H */
#endif
/* CANVAS_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment