Welcome, Guest. Please login or register. Did you miss your activation email?

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.


Messages - toast9

Pages: [1]
1
Window / Re: key press problems
« on: April 22, 2015, 06:21:46 am »
Ah yes, that was it. Thank you very much!  ;D

2
Window / key press problems
« on: April 22, 2015, 05:47:21 am »
I'm having trouble getting keyboard events to work. Please don't say refer to the tutorials, I've looked them over hundreds of times at this point. For now all I want to happen is when I hit space it a statement cout's. What am I missing?

Code: [Select]
// in InputManager.h
sf::Event mEvent;

//in InputManager.cpp
while (Game::getInstance()->getGraphicsSystem()->pollEvent(mEvent))
{
if (mEvent.type == sf::Event::KeyPressed)
{
if (mEvent.key.code == sf::Keyboard::Space)
{
std::cout << "the space key was pressed" << std::endl;
}
}
}

//the poll event
bool GraphicsSystem::pollEvent(sf::Event theEvent)
{
return mWindow.pollEvent(theEvent);
}

3
It says <8192x8192> which is way below the maximum.

4
I'm trying to draw a tile map, but it says the textures are too big. I use loadFromFile to load in a PNG image to the texture. The images are only 64x64, why and where is the size being set to so high?

5
General / Re: creating a shape gives linker errors
« on: March 30, 2015, 03:22:20 am »
I've decided to go with dynamic instead, and modified the properties receptively. It's all working now, thanks both of you for your help!

6
General / Re: creating a shape gives linker errors
« on: March 30, 2015, 12:25:07 am »
I am using Visual Studios 2013. Here's the build:

Code: [Select]
1>------ Build started: Project: FinalProject, Configuration: Debug Win32 ------
1>  Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1> 
1>  cl /c /I"SFML-2.2/include" /I../../../shared/DeanLib /ZI /W3 /WX- /sdl /Od /Oy- /D SFML_STATIC /D _MBCS /D _MBCS /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt main.cpp
1> 
1>  Skipping... (no relevant changes detected)
1>  main.cpp
1>  Microsoft (R) Incremental Linker Version 12.00.21005.1
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1> 
1>  "/OUT:C:\Users\Gabrielle\Desktop\Game Arch\Final Project\Gabby.Mary.FinalProject\FinalProject\Debug\FinalProject.exe" /INCREMENTAL "/LIBPATH:SFML-2.2/lib" /LIBPATH:../../../shared/DeanLib/ kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "sfml-graphics-d.lib" "sfml-window-d.lib" "sfml-audio-d.lib" "sfml-network-d.lib" "sfml-main-d.lib" "sfml-system-d.lib" ../../../shared/DeanLib/Debug/DeanLib.lib /MANIFEST "/MANIFESTUAC:level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG "/PDB:C:\Users\Gabrielle\Desktop\Game Arch\Final Project\Gabby.Mary.FinalProject\FinalProject\Debug\FinalProject.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT "/IMPLIB:C:\Users\Gabrielle\Desktop\Game Arch\Final Project\Gabby.Mary.FinalProject\FinalProject\Debug\FinalProject.lib" /MACHINE:X86 Debug\main.obj
1>main.obj : error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Red" (?Red@Color@sf@@2V12@B)
1>main.obj : error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
1>C:\Users\Gabrielle\Desktop\Game Arch\Final Project\Gabby.Mary.FinalProject\FinalProject\Debug\FinalProject.exe : fatal error LNK1120: 2 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

7
General / Re: creating a shape gives linker errors
« on: March 29, 2015, 08:02:25 pm »
Here are the errors in full:

Error   1   error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Red" (?Red@Color@sf@@2V12@B)

Error   2   error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)

8
General / creating a shape gives linker errors
« on: March 29, 2015, 10:36:01 am »
I'm setting up a sfml project for the first time and I can't seem to get a shape drawn to the screen. I get two linker errors: error lnk2001 unresolved external symbol. One doesn't like sfml's Color:Red and the others doesn't like RenderStates. I can create a window just fine, just can't put anything on it.

Here's the code:


#include<iostream>
#include <SFML/Graphics.hpp>
using namespace std;

int main()
{
   sf::RenderWindow window(sf::VideoMode(600, 800), "SFML works!");

   sf::CircleShape circle;
   circle.setRadius(40);
   circle.setPosition(100, 100);
   circle.setFillColor(sf::Color::Red);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }
      window.clear();
      window.draw(circle);
      window.display();
    }
   return 0;
}

Pages: [1]
anything