Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Charsmud

#1
Installation help / Compiling TGUI with VS2015
20 September 2015, 06:52:22
I am trying to compile TGUI for Visual Studio 2015 because the version I was using previously seemed to not work for VS2015.  However, I keep getting this error when I try to use CMAKE:

SFML found but version too low (requested: 2, found: 1.x.x)
CMake Error at CMakeLists.txt:290 (message):
  CMake couldn't find SFML.  Set the SFML_ROOT entry to SFML's root directory
  (containing "include" and "lib" directories).


Configuring incomplete, errors occurred!
See also "E:/Downloads/TGUI/CMakeFiles/CMakeOutput.log".


I am using SFML 2.3.2.
#2
I recently updated my computer to windows 10, and have been getting the following error:

Severity Code Description Project File Line
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: void __thiscall tgui::CallbackManager::bindCallbackEx(class std::function<void __cdecl(struct tgui::Callback const &)>,unsigned int)" (__imp_?bindCallbackEx@CallbackManager@tgui@@QAEXV?$function@$$A6AXABUCallback@tgui@@@Z@std@@I@Z) referenced in function "public: virtual void __thiscall GuiOptions::loadWidgets(void)" (?loadWidgets@GuiOptions@@UAEXXZ) Byte E:\GameDev\C++\Byte\Byte\GuiOptions.obj 1


I've gotten unresolved external symbol errors before, but I cannot seem to figure this out.  Any help? 
#3
Help requests / Callbacks with the ComboBox
29 December 2014, 03:55:19
Hello!  I am attempting to work with callbacks with the ComboBox.  How do I know what is selected in the box?
#4
Hello!  I am trying to set up a GUI system.  However, my RenderWindow instance is inside of a different class than what I am trying to access it from, and I can only access it via a RenderWindow*.  Is there a way to set the tgui::Gui to the RenderWindow* that I have, or do I need to do something else?  (Sorry if this is a little noob, I'm not that awesome at C++)
#5
Hello!  I am getting the following error when I attempt to run my program:


The procedure entry point ?begin@String@sf@QAE?AV?$_String_iterator@V?$_String_val@U?$_Simple_types@I@std@@@std@@@std@@XZ could not be located in the dynamic link library sfml-system-2.dll.


This error occurs during runtime before a window appears.  This error only appeared after the installation of TGUI, which leads me to believe that it is the cause.  I have tried both the version of TGUI that the download includes and building it.  I am using VS2010.  Here is the .cpp file and the .hpp relevant line:



#pragma once

#include "ResourceHolder.hpp"
#include "ResourceIdentifiers.hpp"
#include "Player.hpp"
#include "StateStack.hpp"

#include <SFML/System/Time.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/Text.hpp>

#include <TGUI\TGUI.hpp>


class Application
{
private:
sf::RenderWindow mWindow;
tgui::Gui mGui;

};


and here is the complete .cpp file:


#include "Application.hpp"
#include "Utility.hpp"
#include "State.hpp"
#include "StateIdentifiers.hpp"
#include "TitleState.hpp"
#include "GameState.hpp"
#include "MenuState.hpp"
#include "PauseState.hpp"

const sf::Time Application::timePerFrame = sf::seconds(1.f/60.f);

Application::Application()
: mWindow(sf::VideoMode(640, 480), "States", sf::Style::Close)
, mGui(mWindow)
, mTextures()
, mFonts()
, mPlayer()
, mStateStack(State::Context(mWindow, mTextures, mFonts, mPlayer))
, mStatisticsText()
, mStatisticsUpdateTime()
, mStatisticsNumFrames(0)
{
mWindow.setKeyRepeatEnabled(false);

mFonts.load(Fonts::Main, "Media/Sansation.ttf");
mTextures.load(Textures::TitleScreen, "Media/Textures/TitleScreen.png");

mStatisticsText.setFont(mFonts.get(Fonts::Main));
mStatisticsText.setPosition(5.f, 5.f);
mStatisticsText.setCharacterSize(10u);

mGui.setGlobalFont(mFonts.get(Fonts::Main));

registerStates();
mStateStack.pushState(States::Menu);
}


void Application::registerStates()
{
mStateStack.registerState<MenuState>(States::Menu);
mStateStack.registerState<GameState>(States::Game);
mStateStack.registerState<PauseState>(States::Pause);
}

void Application::run()
{
sf::Clock clock;
sf::Time timeSinceLastUpdate = sf::Time::Zero;

while (mWindow.isOpen())
{
sf::Time dt = clock.restart();
timeSinceLastUpdate += dt;
while (timeSinceLastUpdate > timePerFrame)
{
timeSinceLastUpdate -= timePerFrame;

processInput();
update(timePerFrame);

// Check inside this loop, because stack might be empty before update() call
if (mStateStack.isEmpty())
mWindow.close();
}

updateStatistics(dt);
render();
}
}

void Application::processInput()
{
sf::Event event;
while (mWindow.pollEvent(event))
{
mStateStack.handleEvent(event);
mGui.handleEvent(event);

if (event.type == sf::Event::Closed)
mWindow.close();
}
}

void Application::update(sf::Time dt)
{
mStateStack.update(dt);
}

void Application::render()
{
mWindow.clear();

mStateStack.draw();

mWindow.setView(mWindow.getDefaultView());
mWindow.draw(mStatisticsText);

mGui.draw();

mWindow.display();
}

void Application::updateStatistics(sf::Time dt)
{
mStatisticsUpdateTime += dt;
mStatisticsNumFrames += 1;
if (mStatisticsUpdateTime >= sf::seconds(1.0f))
{
mStatisticsText.setString("FPS: " + toString(mStatisticsNumFrames));

mStatisticsUpdateTime -= sf::seconds(1.0f);
mStatisticsNumFrames = 0;
}
}



Any ideas?