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 - Overkiller

Pages: [1]
1
General / Cannot open SFML app in VNC
« on: December 16, 2014, 06:34:14 pm »
Hi!
I wrote small app in SFML for Raspberry Pi B+. I had to compile it by myself, so for 100% all dependencies are met. Problem is following: it won't start when I want to test it through VNC connection. The output is following:
Failed to use the XRandR extension while to get the desktop video modes
. Running as root does not change something. When I write
xrandr -q
it says:
RandR extension missing
. So, I that possible to run SFML based apps through VNC? My VNC server:
tightvncserver

2
Network / Re: Sfml Network module fails to link. (Linker Errors)
« on: September 08, 2013, 08:52:50 pm »
Here you are:
1>------ Build started: Project: ConsoleApplication2, Configuration: Debug Win32 ------
1>  Microsoft (R) C/C++ Optimizing Compiler Version 17.00.60610.1 for x86
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1>  
1>  cl /c /I"C:\SFML-2.0\include" /ZI /nologo- /W3 /WX- /sdl /Od /Oy- /D SFML_DYNAMIC /D WIN32 /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc110.pdb" /Gd /TP /analyze- /errorReport:prompt client.cpp Source.cpp
1>cl : Command line warning D9035: option 'nologo-' has been deprecated and will be removed in a future release
1>  
1>  Skipping... (no relevant changes detected)
1>  Source.cpp
1>  client.cpp
1>  Microsoft (R) Incremental Linker Version 11.00.60610.1
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1>  
1>  "/OUT:F:\Programowanie\ConsoleApplication2\Debug\ConsoleApplication2.exe" /INCREMENTAL "/LIBPATH:C:\SFML-2.0\lib" "sfml-audio-d.lib" "sfml-graphics-d.lib" "sfml-main-d.lib" "sfml-network-d.lib" "sfml-system-d.lib" "sfml-window-d.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 /MANIFEST "/MANIFESTUAC:level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG "/PDB:F:\Programowanie\ConsoleApplication2\Debug\ConsoleApplication2.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT "/IMPLIB:F:\Programowanie\ConsoleApplication2\Debug\ConsoleApplication2.lib" /MACHINE:X86 Debug\client.obj
1>  Debug\Source.obj
1>client.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::UdpSocket::UdpSocket(void)" (__imp_??0UdpSocket@sf@@QAE@XZ) referenced in function "public: __thiscall client::client(void)" (??0client@@QAE@XZ)
1>client.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: enum sf::Socket::Status __thiscall sf::UdpSocket::bind(unsigned short)" (__imp_?bind@UdpSocket@sf@@QAE?AW4Status@Socket@2@G@Z) referenced in function "public: bool __thiscall client::bindSocket(void)" (?bindSocket@client@@QAE_NXZ)
1>client.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::UdpSocket::~UdpSocket(void)" (__imp_??1UdpSocket@sf@@UAE@XZ) referenced in function "public: __thiscall client::~client(void)" (??1client@@QAE@XZ)
1>F:\Programowanie\ConsoleApplication2\Debug\ConsoleApplication2.exe : fatal error LNK1120: 3 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

3
Network / Re: Sfml Network module fails to link. (Linker Errors)
« on: September 08, 2013, 08:42:30 pm »
Thank you for reply.

Compiler version is okay for 100%, because it is my second project and i think that my architecture is okay, because i'm using 64 bit VS 2012.

4
Network / Sfml Network module fails to link. (Linker Errors)
« on: September 08, 2013, 08:11:56 pm »
Hi, it's me again :)

The problem is, that my IDE (VS 2012), throws linker errors. All of these are from SFML Network module. I have set everything from tutorial on site. Is there any way to repair this?

Images are in attachments.

5
General / Re: [c++]Can't initialize bool array with for loop
« on: August 13, 2013, 01:49:57 pm »
@Laurent
OMG, yes that's it! :D I was an oversight...

@Nexus
I didn't knew about std::fill and std::array.
Why i should avoid using in header files? I was always writing using namespace sf or using sf::xxx

So far thank you for help :)

6
General / [c++]Can't initialize bool array with for loop
« on: August 13, 2013, 12:50:54 pm »
Hello!

Sorry for my lame question, but how to initialize bool array with any of loops? I was trying to initialize with for loop:
mouse class:
//there is declaration of my array, the rest is not improtant:
#pragma once
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <iostream>
using sf::Mouse;
using sf::Vector2i;
using sf::Vector2f;
using sf::RectangleShape;
using sf::Color;
using sf::FloatRect;
using std::cout;
using std::endl;
class mysz
{
public:
        mysz(void);
        Vector2i pozycjaMyszy;
        Vector2i pobierzPozycjeMyszy();
        Vector2f pozycjaFloat;
        RectangleShape kwadratMysz;
        FloatRect kolizjaKwadratMysz;
        bool kolizja[9]; // this is it
        void ustawParametryKwadratu();
        void ustawPozycje();
        void sprawdzKolizje(FloatRect porownywana, int krokPetli);
        ~mysz(void);

};
mouse cpp:
#include "mysz.h"


mysz::mysz(void)
{
        for(int i = 0; i > 9; i++)
        {
                kolizja[i] = false; // here i try to initialize the array
        }
}

Vector2i mysz::pobierzPozycjeMyszy()
{
        pozycjaMyszy = Mouse::getPosition();
        pozycjaFloat = static_cast<Vector2f>(pozycjaMyszy);
        return pozycjaMyszy;
}
void mysz::ustawParametryKwadratu()
{
        kwadratMysz.setSize(Vector2f (32,32));
        kwadratMysz.setFillColor(Color::White);
        kolizjaKwadratMysz = kwadratMysz.getGlobalBounds();
}
void mysz::sprawdzKolizje(FloatRect porownywana, int krokPetli)
{

        if(kolizjaKwadratMysz.intersects(porownywana))
        {
//              wystapilyKolizje[krokPetli] = true;
        }
}
mysz::~mysz(void)
{
}

 
but VS 2012 debugger show that all of array fields have: "true (204)"
So, can someone help with my problem?

7
AlexAUT, sorry for not translating variables. I'm from Poland and with my Polish friend are writng a game for competition, so i'm using Polish names for easietr understandingo of code, for my friend.

Your anwser repaired my problem so, thank you for help. :) I was thinking about issue, but any of my try wasn't repairing issue.

8
Graphics / Sprite returning to orginal posistion, after setPosition
« on: July 24, 2013, 07:02:42 pm »
Hi!
It's my first post here, so I want to thank to LaurentGomila for creating such great lib!

Here is my code, not very complex and please don't blame for it. I have small C++ experience:
Mouse class:
#pragma once
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
using namespace sf;
// class for maitain mouse
class mysz
{
public:
        mysz(void);
        Vector2i pozycjaMyszy; // variable for mouse coordinates
        Vector2i pobierzPozycjeMyszy(); // method for getting them
        Vector2f pozycjaFloat; // same as pozycjaMyszy but in float(for moving sprite)
        void ustawPozycje(); // later iplemented
        float poprzedniaPozycjaX;
        float poprzedniaPozycjaY;
        ~mysz(void);
};
 
And their implementation:
#include "mysz.h"


mysz::mysz(void)
{
}
Vector2i mysz::pobierzPozycjeMyszy()
{
        pozycjaMyszy = Mouse::getPosition();
        pozycjaFloat = static_cast<Vector2f>(pozycjaMyszy); //changing from Vector2i to Vector2f
        poprzedniaPozycjaX = pozycjaFloat.x;
        poprzedniaPozycjaY = pozycjaFloat.y;
        return pozycjaMyszy;
}

mysz::~mysz(void)
{
}

 
Image class:
//maitain images
#pragma once
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
using namespace sf;

class obrazek
{
public:
        obrazek(void);
        void stworz();
        void nadajKolor();
        void zmienPozycje(float x, float y); //for setting position of image
        void ustawPozycje(float x, float y);
        int zaladuj();
        ~obrazek(void);
        Texture teksturaObrazka;
        Sprite duchObrazek;
};
 
And implementation:
#include "obrazek.h"


obrazek::obrazek(void)
{
}
void obrazek::stworz()
{
}
void obrazek::nadajKolor()
{

}
void obrazek::zmienPozycje(float x, float y)
{
        duchObrazek.setPosition(x,y);
}
int obrazek::zaladuj()
{
        if(!teksturaObrazka.loadFromFile("01.png"))
        {
                return EXIT_FAILURE;
        }else
        {
                duchObrazek.setTexture(teksturaObrazka);
                duchObrazek.setOrigin(400,300);
                return EXIT_SUCCESS;
        }
}
void obrazek::ustawPozycje(float x, float y)
{
        duchObrazek.setPosition(x,y);
}
obrazek::~obrazek(void)
{
}
 
Main:
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include "obrazek.h"
#include "mysz.h"
using namespace sf;
int main()
{
    RenderWindow oknoGry(VideoMode(1024, 768), "Okno Glowne", Style::Close);
        while(oknoGry.isOpen())
        {
                obrazek obrazekJeden;
                mysz myszGry;
                myszGry.pobierzPozycjeMyszy();
                obrazekJeden.zaladuj();
                Event Zdarzenia;
               
               
                while(oknoGry.pollEvent(Zdarzenia))
                {
                        if(Zdarzenia.type == Event::Closed)
                        {
                                oknoGry.close();
                                return 0;
                        }
                        if(Keyboard::isKeyPressed(Keyboard::P))
                        {
                                obrazekJeden.zmienPozycje(myszGry.pozycjaFloat.x, myszGry.pozycjaFloat.y);
                        }
                       
                }
               
                oknoGry.clear();
       
                oknoGry.draw(obrazekJeden.duchObrazek);
                oknoGry.display();
        }
    return 0;
}
 
My issuse is following: after releasing "P" key my sprite is returning to left upper corner. I was tryin to fix that but, it doesn't worked.

Pages: [1]