This file contains hidden or 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> | |
struct Cursor | |
{ | |
Cursor() : | |
changed{ false }, | |
current{ sf::Cursor::Arrow } | |
{ | |
arrow.loadFromSystem(sf::Cursor::Arrow); | |
hand.loadFromSystem(sf::Cursor::Hand); |
This file contains hidden or 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{ { 1280, 720 }, "Test"}; | |
window.setFramerateLimit(60); | |
while(window.isOpen()) | |
{ | |
sf::Event event; |
This file contains hidden or 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 <iostream> | |
#include <fstream> | |
#include <string> | |
bool IbEeaC(const std::string& word) | |
{ | |
for(auto position = word.find("ei"); position != std::string::npos; position = word.find("ei", position += 2)) | |
{ | |
if (position == 0 || word[position - 1] != 'c') | |
{ |
This file contains hidden or 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
// Link statically with GLEW | |
#define GLEW_STATIC | |
// Headers | |
#include <GL/glew.h> | |
#include <SOIL.h> | |
#include <SFML/Window.hpp> | |
// Shader sources | |
const GLchar* vertexSource = R"glsl( |
This file contains hidden or 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
#define _CRT_SECURE_NO_WARNINGS | |
#include <cstdio> | |
int main() | |
{ | |
// Search the first 32MiB for a Z character | |
constexpr auto maxToRead = 32 * 1024 * 1024; | |
auto f = std::fopen("test.dat", "rb"); |
This file contains hidden or 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
#define _CRT_SECURE_NO_WARNINGS | |
#include <cstdio> | |
#include <chrono> | |
int main() | |
{ | |
using namespace std::chrono_literals; | |
auto f = std::fopen("test.dat", "rb"); |
This file contains hidden or 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() | |
{ | |
sf::RenderWindow window(sf::VideoMode(1280, 720), "Minimal, complete and verifiable example"); | |
window.setFramerateLimit(60); | |
while (window.isOpen()) | |
{ |
This file contains hidden or 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 <random> | |
#include <vector> | |
#include <SFML/Graphics.hpp> | |
int main() | |
{ | |
sf::RenderWindow window{ {1280, 720}, "Test window" }; | |
std::random_device rd; |
This file contains hidden or 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 "Application.hpp" | |
Application::Application() | |
: m_window{{1280, 720}, "Sample SFML Setup"} | |
, m_shape{{200.f, 200.f}} | |
{ | |
} | |
void Application::run() | |
{ |
This file contains hidden or 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 <SFML/Audio.hpp> | |
#include "world.h" | |
int main() | |
{ | |
initializegame(); | |
generatecurrentlevel(levelnumber); | |
while(window.isOpen() && !sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)) |