This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////////// | |
// Headers | |
//////////////////////////////////////////////////////////// | |
#include "Stroke.hpp" | |
#include <SFML/OpenGL.hpp> | |
const float myRand(float low, float high) | |
{ | |
return static_cast<float>(std::rand()) / RAND_MAX * (high - low) + low; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SFML/Network.hpp> | |
#include <SFML/System.hpp> | |
#include <iostream> | |
#include <winsock.h> | |
int main() | |
{ | |
std::vector<sf::UdpSocket*> sockets; | |
sf::SocketSelector selector; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SFML/Graphics.hpp> | |
int main() | |
{ | |
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML works!"); | |
window.setFramerateLimit(60); | |
sf::Font font; | |
font.loadFromFile("DroidSans.ttf"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SFML/Graphics.hpp> | |
#include <iostream> | |
int main() | |
{ | |
while(true) | |
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) | |
std::cout << "test" << std::endl; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef ENTITY_HPP | |
#define ENTITY_HPP | |
#include <SFML/Graphics/Sprite.hpp> | |
#include <SFML/Graphics/Drawable.hpp> | |
#include <SFML/Graphics/Transformable.hpp> | |
#include <SFML/Graphics/RenderStates.hpp> | |
// Forward declerations | |
namespace sf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SFML/Config.hpp> | |
#include <SFML/Audio.hpp> | |
#include <cmath> | |
#include <cstdint> | |
#include <vector> | |
int main() | |
{ | |
sf::SoundBuffer buffer1, buffer2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SFML/Graphics.hpp> | |
#include <thread> | |
int main() | |
{ | |
sf::RenderWindow window({1920, 1080}, "Screenshot!"); | |
sf::Texture tex; | |
tex.create(1920, 1080); | |
sf::Clock cl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "B.hpp" | |
#include "C.hpp" | |
B::B() | |
: m_c(nullptr) | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Group.hpp" | |
Group::Group() | |
: m_drawables{} { | |
} | |
void Group::draw(sf::RenderTarget& target, sf::RenderStates states) const { | |
for(const auto& drawable : m_drawables) { | |
target.draw(drawable, states); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function() | |
{ | |
if(statement) | |
return value_one; | |
else | |
return value_two; | |
} |
OlderNewer