Hey
I am trying to build some code for my game, but everytime I try to compile it my compiler doesn't create a .exe data.
It's really simple so far:
main.cpp
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <sstream> // String stream library
#include <iostream>
#include "Game_Board.h"
int main()
{
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
Menue(App); //Before App.IsOpened() we go visit the Menue
sf::Image Image;
sf::Sprite Sprite(Image);
while (App.IsOpened())
{
sf::Event Event;
while (App.GetEvent(Event))
{
if (Event.Type == sf::Event::Closed)
App.Close();
}
App.Clear();
App.Draw(Sprite);
App.Display();
}
return EXIT_SUCCESS;
}
FS_STATES.cpp
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include "Game_Board.h"
int Menue(sf::RenderWindow &App)
{
Window_State = FS_Menue; // Window state is set to Menue
App.Clear(); // Clear the whole Window
sf::Image IMG_Buttons; // Create the Image for all buttons
// After load it's Image in case it fails return back with (!=) 0
if (!IMG_Buttons.LoadFromFile("Buttons.bmp")
return EXIT_FAILURE;
sf::Sprite Button_Start(IMG_Buttons); // Create the Sprite for Button : Start
Button_Start.SetPosition(325.f, 150.f); // Change it's Position
// Start the Menue loop as long as the Window state contains FS_Menue
while (Window_State == FS_Menue)
{
// Create a Event for the Menue (to handle buttons, clicks etc.)
sf::Event Menue_Event;
while (App.GetEvent(Event)) //Event loop for events
{
if (Event.Type == sf::Event::Closed)
App.Close();
}
App.Clear();
App.Draw(Button_Start);
App.Display();
}
return EXIT_SUCCESS ;
}
Game_Board.h
#ifndef BOARD
#define BOARD
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#define BOARD_Y_SIZE //Can be changed (5-20)
#define BOARD_X_SIZE //Can be changed (5-20)
enum Token
{
Empty,
Red,
Blue,
};
// And these, the outline types of the tokens
enum Outline
{
Normal,
Highlight
};
// Returned when trying to place a token in a column
//
enum Move
{
Placed,
Full,
EndOfGame
};
// Enum for all possible Window states.
// This Programm just uses Menue, Game, Init and Pause
enum WindowState
{
FS_Menue,
FS_Pause,
FS_Game,
FS_Init
};
// This template allows you to add a varible to a string in order to print out
template <typename T>
std::string str(const T& x)
{
std::ostringstream oss;
oss << x;
return oss.str();
}
int Window_State = FS_Init; //Holds the state info for the window , starts with "FS_Init"
int Menue(sf::RenderWindow &App);
Compiler post :
1. ||Info: resolving vtable for sf::Spriteby linking to __imp___ZTVN2sf6SpriteE |
obj\Debug\FS_STATES.o
2.||In function `_ZNSt8_Rb_treeIPN2sf11ResourcePtrINS0_5ImageEEES4_St9_IdentityIS4_ESt4lessIS4_ESaIS4_EE11_M_put_nodeEPSt13_Rb_tree_nodeIS4_E':|
3.||warning: auto-importing has been activated without --enable-auto-import specified on the command line.|
||=== Build finished: 0 errors, 1 warnings ===|
Thanks to you all : )