-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjdwExample.cpp
More file actions
37 lines (26 loc) · 827 Bytes
/
jdwExample.cpp
File metadata and controls
37 lines (26 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "include/Jackdaw.h"
int main()
{
const int WIDTH = 400, HEIGHT = 400;
jdw::Application::init(WIDTH, HEIGHT, L"Hello world!", false);
jdw::Polygon polygon = {
{
{3, 0}, {9, 0}, {12, 3}, {12, 9},
{9, 12}, {3, 12}, {0, 9}, {0, 3}
},
{0.0f, 1.0f, 0.0f, 1.0f}
};
polygon.setScale({4, 4});
jdw::setFillColor({ 0.9f, 0.9f, 0.9f, 1.0f });
double deltaTime;
while (jdw::Application::run())
{
deltaTime = jdw::getDeltaTime();
polygon.setPosition(jdw::getMousePosition());
if (jdw::isHeld(jdw::KEY::LMB))
polygon.setRotation( polygon.getRotation() + 1.0f * (float)deltaTime );
jdw::draw(polygon);
}
jdw::Application::terminate();
return 0;
}