Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Prog2
/
eloadas_peldak
/
ea_05
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
602dc92b
authored
Feb 28, 2021
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sdl2
parent
055818b4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
10 deletions
+23
-10
SDL_alakzat/alakzat.cbp
+4
-5
SDL_alakzat/kor.cpp
+3
-2
SDL_alakzat/main.cpp
+13
-1
SDL_alakzat/szakasz.cpp
+3
-2
No files found.
SDL_alakzat/alakzat.cbp
View file @
602dc92b
...
...
@@ -30,7 +30,10 @@
</Target>
</Build>
<Compiler>
<Add
option=
"-pedantic-errors"
/>
<Add
option=
"-pedantic"
/>
<Add
option=
"-Wall"
/>
<Add
option=
"-std=c++11"
/>
<Add
directory=
"$(#sdl.include)"
/>
</Compiler>
<Linker>
...
...
@@ -57,10 +60,6 @@
<Unit
filename=
"szakasz.cpp"
/>
<Unit
filename=
"szakasz.h"
/>
<Unit
filename=
"szin.h"
/>
<Extensions>
<code_completion
/>
<debugger
/>
<envvars
/>
</Extensions>
<Extensions
/>
</Project>
</CodeBlocks_project_file>
SDL_alakzat/kor.cpp
View file @
602dc92b
...
...
@@ -7,6 +7,7 @@
/// Kört rajzoló rajzol fv.
void
Kor
::
rajzol
()
const
{
filledCircleColor
(
renderer
,
p0
.
x
,
p0
.
y
,
r
,
sz
);
// SDL_RenderPresent(renderer);
// SDL_Flip(scr); /// nem a legjobb megoldás a villogás miatt, de most elmegy
#ifdef VILLOG
SDL_RenderPresent
(
renderer
);
#endif
}
SDL_alakzat/main.cpp
View file @
602dc92b
/**
* \file main.cpp
* Bugyuta demó az SDL-lel kombinált alakzat osztályok
kipróbál
ására.
* Bugyuta demó az SDL-lel kombinált alakzat osztályok
bemutat
ására.
* Felrajzol pár alakzatot, melyek az egérmozgással együtt mozognak.
* (csak az irányt követik, nem a mozgás nagyságát)
* Bal gomb lenyomva: drag
* Jobb gomb: kört rajzol
* középső gomb: szakaszt rajzol
*
*
* Ha a VILLOG makró definiált (projekt szinten, vagy az alakat.h-ban), akkor
* minden rajzol meghívja az SDL_RenderPresent függvény.
* Egyébként csak az események kezelésénél hívja az eseményhurok.
*/
#include <iostream>
#include <fstream>
...
...
@@ -69,7 +77,9 @@ int main(int argc, char* argv[]) {
idom
[
i
]
->
mozgat
(
Pont
(
dx
,
dy
));
// kicsit mozdítunk rajta
idom
[
i
]
->
rajzol
();
// kirajzoljuk
}
#ifndef VILLOG
SDL_RenderPresent
(
renderer
);
#endif
}
break
;
...
...
@@ -91,7 +101,9 @@ int main(int argc, char* argv[]) {
idom
[
db
]
=
new
Kor
(
Pont
(
ev
.
button
.
x
,
ev
.
button
.
y
),
40
,
RED
);
idom
[
db
]
->
rajzol
();
++
db
;
#ifndef VILLOG
SDL_RenderPresent
(
renderer
);
#endif
}
break
;
...
...
SDL_alakzat/szakasz.cpp
View file @
602dc92b
...
...
@@ -7,6 +7,7 @@
/// Szakaszt rajzoló rajzol fv.
void
Szakasz
::
rajzol
()
const
{
thickLineColor
(
renderer
,
p0
.
x
,
p0
.
y
,
pv
.
x
+
p0
.
x
,
pv
.
y
+
p0
.
y
,
3
,
sz
);
// SDL_RenderPresent(renderer);
// SDL_Flip(scr); /// nem a legjobb megoldás a villogás miatt, de most elmegy
#ifdef VILLOG
SDL_RenderPresent
(
renderer
);
#endif
}
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