-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest.h
43 lines (40 loc) · 907 Bytes
/
Test.h
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
38
39
40
41
42
43
#ifndef TEST_H
#define TEST_H
#include"stdafx.h"
#include<iostream>
class Test {
private:
sf::RenderWindow* window;
sf::Texture texture;
sf::Sprite sprite;
sf::View fixed;
public:
void render(){
//system("dir");
const std::string name = "images/bullet.png";
this->texture.loadFromFile(name);
this->sprite=sf::Sprite(texture);
//fixed = this->window->getView();
}
void update(){
//static_cast<sf::Vector2f>(sf::Mouse::getPosition(*window))
this->sprite.setPosition(sf::Vector2f(0.f, 0.f));
//this->sprite.setPosition(static_cast<sf::Vector2f>(sf::Mouse::getPosition(*window)));
window->clear();
//window->setView(fixed);
window->draw(sprite);
}
void setWindow(sf::RenderWindow* window) {
this->window = window;
}
sf::RenderWindow* getWindow() {
return window;
}
sf::View getView() {
return fixed;
}
sf::Sprite getSprite() {
return sprite;
}
};
#endif// TEST_H