Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //SFML doit etre mis dans le dossier racine de C:
- #include "case.h"
- #include "mouse.h"
- #include <SFML/Graphics.hpp>
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main(int argc, char** argv)
- {
- int x = 800;
- int y = 600;
- int numCase = numberCase();
- int **grid;
- sf::RenderWindow window(sf::VideoMode(x, y), "Hello SFML", sf::Style::Default);
- grid = (int**)malloc(pow(numCase, 2) * sizeof(int*));
- if (grid != NULL)
- {
- for (int i = 0; i < pow(numCase, 2); i++)
- {
- grid[i] = (int*)malloc(sizeof(int) * 4);
- }
- }
- **grid = posCase(grid, numCase, x, y);
- while (window.isOpen())
- {
- clickMouse(grid, numCase, window);
- sf::Event event;
- while (window.pollEvent(event))
- {
- if (event.type == sf::Event::Closed)
- window.close();
- }
- window.clear();
- window.display();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement