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

Pages: [1] 2
1
General / SFML Game Book (github code) Run-time error & LNK2019 error.
« on: January 26, 2014, 03:04:56 pm »
So I got the github code from Laurent, ran it through CMake for VS12 and everything seems to have worked out, I went to chapter 2 (where I'm at on the book right now) and fitted in the additional SFML compiler includes and linker libraries + resources.

Now I had to place the debug dlls here:


And running the thing in release slapped me in the face with a ton of LNK2019 errors which I'm not even gonna bother with right this moment.

In debug, the execution dies out right were the breakpoint is set:


I'm assuming this is a directory issue, however I have no clue where I should be putting the stuff.  I used CMake to generate everything in the same folder (source and target are the same) but it clearly didn't pick them up...

Any clue about this, and whether or not the CMake caused an error or if this is something normal that should be taken care of prior to compilation?

Cheers.

Lupo :)

2
General / Re: LNK1181: VS12
« on: January 24, 2014, 06:45:08 pm »
Thanks, it worked.


3
General / Re: LNK1181: VS12
« on: January 24, 2014, 06:01:33 pm »
1>------ Build started: Project: Project1, Configuration: Release 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"D:\Programming\SFML\SFML-2.1\include" /Zi /W3 /WX- /sdl /O2 /Oi /Oy- /GL /D _MBCS /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Release\\" /Fd"Release\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt main.cpp
1>  
1>  main.cpp
1>  Microsoft (R) Incremental Linker Version 12.00.21005.1
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1>  
1>  "/OUT:D:\Programming\SFML\Projects\Project1\Release\Project1.exe" "/LIBPATH:D:\Programming\SFML\SFML-2.1\lib" "sfml-graphics.lib" "sfml-window.lib" "sfml-system.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:D:\Programming\SFML\Projects\Project1\Release\Project1.pdb" /OPT:REF /OPT:ICF /LTCG /TLBID:1 /DYNAMICBASE /NXCOMPAT "/IMPLIB:D:\Programming\SFML\Projects\Project1\Release\Project1.lib" /MACHINE:X86 /SAFESEH Release\main.obj
1>LINK : fatal error LNK1181: cannot open input file 'sfml-graphics.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

The linker setting:


Actual directory it leads to:


Of course I did the input dependencies separately for Debug and Release as the guide explains it.

4
General / LNK1181: VS12
« on: January 24, 2014, 12:36:00 pm »
Followed the tutorial, went through all the other LNK1181 errors in the forums and I feel like I'm skipping something simple.  And I had this working before too, but now that I formatted and decided to get VS12, I'm stuck with:

1>------ Build started: Project: Project1, Configuration: Release Win32 ------
1>LINK : fatal error LNK1181: cannot open input file 'sfml-graphics.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

So what did I do?

Downloaded CMake, generated for Visual Studio 12 (2013) in the same directory "D:/Programming/SFML/SFML-2.1"

Went through the following tutorial: http://www.sfml-dev.org/tutorials/2.1/start-vc.php

And despite feeling like the error is something on my end (poor configuration) I just can't figure out what's wrong...

I also feel as if the folder structure has changed somewhat.  In the guide linked above it says:

Quote
Now compile the project, and if you linked to the dynamic version of SFML, don't forget to copy the SFML DLLs (they are in <sfml-install-path/bin>) to the directory where your compiled executable is. Then run it

And yet my SFML has no bin folder, I find my DLLs in <sfml-install-path>/lib/Release or <sfml-install-path>/lib/Debug

I placed my dll files in the <Projects>\Project1\Project1\Release folder and built as release, but that error typed out above happened.

5
General discussions / Re: SFML Game Development -- A book on SFML
« on: July 07, 2013, 01:47:29 pm »
I have purchased the SFML Game Development book from Amazon UK (as directed by packtpub) and I attempted to find some way of linking the purchase with my PacktPub account (freshly created).

This is of course in order to acquire access to the e-book, which I haven't had any luck in pulling off thus far.  The price for the print version however is equal to that on packtpub from amazon uk, and therefore I assume it will grant me the ebook version as well.

I'll keep you updated on how this turns out, unless someone has already found a solution to it, in which case I urge you to post it for my benefit and anyone else who might require it =]

6
General / Re: SFML freezes when mouse moves (VS 2010)
« on: April 30, 2013, 07:34:00 am »
Since I was the one who got this problem when running Grimshaw's files I'll explain the exact scenario.  As mentioned by Grim, it was the release version, not the VS10 environment.  However, I am on Win7 64bit, not 32.

Additionally, the application works "perfectly fine" even while moving the mouse, besides the actual drawing.

That is to say, I can left click to spawn circles, right click to spawn particle boxes or w/e and the console provides this output, even while doing this and moving the mouse.  However moving the mouse completely halts the rendering, even though updates are clearly still happening (objects still being created and physics is still being worked out).

I can spend 1 minute spinning the mouse about (freezing the screen throughout) and as I left and right click, the console provides prompts.  Once stopping mouse movement I'll see all the objects spawned neatly stacked up at the bottom, waiting for some other kind of event.  So I guess the question is: How is moving the mouse somehow "skipping" the draw method?  Maybe the source code could shed some light.

7
General discussions / Re: A new logo for SFML
« on: April 28, 2013, 11:48:12 am »
Quote
However I don't like the new one, it's way too cluttered (the thing that we are trying to leave behind since months) and has strange fonts.


I actually find these images to be really neat.The little box kind of shows the power of sfml and the text itself looks good.  I like the last row personally, especially the one in the 2nd column, looks sweet.

Can we see that on the website?

8
General discussions / Re: A new logo for SFML
« on: April 27, 2013, 04:23:45 pm »




I think this is my favorite one.

Me too

me three   :D
Me four. The other one looks too dirty and evil in some way, while this one is clean and happy.
Me five :D

I guess we should give him his money, this feels like the best option.  The arrow twists at the start as work is done and then shoots straight out at the end showing speed, logo is clean, light and easy on the eyes, full score imo!

9
Graphics / Re: [SOLVED] Background Image Not Loading
« on: April 27, 2013, 01:58:56 pm »
I read your reply, and I did spot about half the stuff you pointed out.  The leaks however didn't occur to me, sadly since I'm working on getting used to a Tile Engine I have no other reference, I'm following this guide against my heart but I'll try to keep a high guard up, possibly share bits and pieces of my code as I go along the development and have some stuff lined out :p

10
Graphics / Re: [SOLVED] Background Image Not Loading
« on: April 27, 2013, 02:51:04 am »
@Nexus Just speculation but I think he's following this tutorial to the letter http://www.dreamincode.net/forums/topic/230524-c-tile-engine-from-scratch-part-1/

I'm following it too, although doing changes here and there when things just don't make much sense.

I can see some practices are not ideal in it, but for lack of better tutorials it's better than nothing to get started quickly on Tile Engines...

11
Graphics / Re: Making object draw itself issue.
« on: April 27, 2013, 02:44:55 am »
Sometimes, stuff just slips and mistakes happen, no matter how hard you try  ::)

12
Graphics / Tile Engine - Image/Texture? What's best to use for sprites
« on: April 27, 2013, 02:44:05 am »
I'm currently building the foundations for a working tile engine, prior to getting to develop more content to test with, and I'm stuck between 2 choices, Images and Textures.  Can someone explain what would be most appropriate.

Also I noticed sprites don't have a setImage anymore, or it was moved somehow, and setTexture has no intention of taking an Image since I see no overload to do that, how are we supposed to treat images, what are they there for?

Thanks =]

13
Graphics / Re: Making object draw itself issue.
« on: April 26, 2013, 01:05:10 am »
Noted.  Didn't notice the setTexture was by reference!

Thanks =]

14
Graphics / Re: Making object draw itself issue.
« on: April 25, 2013, 11:31:54 pm »
... Talk about idiocy i uhh changed the texture by reference and it worked... still... WHY does that happen lol? 

Doesn't it just clone the texture into the object's sprite and use it anyways by local reference or does it somehow die and lose the asset when drawing it from the object itself as it goes back out to the main function?

I felt i had a decent grasp of OOP but this is a bit puzzling =/

15
Graphics / Making object draw itself issue.
« on: April 25, 2013, 11:30:30 pm »
Allright I'm trying to draw a character sprite from a sprite sheet (3 wide, 4 deep), only drawing IntRect(32,0,32,32) specifically for now, just want some valid output.  To quickly describe my current setup this is what I have...

main.cpp  Supposed to do the standard stuff.  Build a render window, basic initialization and some simple event checking, then just clearing to grey and drawing the object's sprite.
#include <SFML/Graphics.hpp>
#include <iostream>
#include "creature.hpp"

#define screenWidth 800
#define screenHeight 600

int main ( void )
{
        // ############################### VARIABLE DECLARATION ############################### //
       
        // Window creation
        sf::VideoMode vMode(screenWidth, screenHeight, 32);
        sf::RenderWindow App (vMode,"Test");
        App.setFramerateLimit(60);
        App.setVerticalSyncEnabled(true);
        std::cout << "App Initialized" << std::endl;

        // Texture loading / Sprite Creation
        sf::Texture playerSheet;
        if (!playerSheet.loadFromFile("player.png"))
                return EXIT_FAILURE;
       
        // Create creature object
        creature player(playerSheet,sf::IntRect(32,0,32,32));

        // ############################### GAME LOOP ############################### //
        while (App.isOpen())
        {
                // ############################### EVENTS ############################### //
                sf::Event event;
                while (App.pollEvent(event))
                {
                        switch (event.type)
                        {
                        case sf::Event::Closed:
                                App.close();
                                break;

                        case sf::Event::KeyPressed:
                                switch (event.key.code)
                                {
                                case sf::Keyboard::Escape:
                                        App.close();
                                        break;
                                }
                        break;
                        }
                }


                // ############################### DRAW ############################### //#
                App.clear(sf::Color(125,125,125));

                player.draw(App);

                App.display();
        }      
}

creature.hpp Now as for the object's draw function:
#pragma once // Avoid multiple includes

#include <SFML/Graphics.hpp>

class creature
{
public:
        creature(sf::Texture tex, sf::IntRect zone);            // Constructor
        ~creature(void);                                                                        // Destructor
        void draw (sf::RenderWindow& App);

private:
        // Visual
        sf::Sprite creatureSpr;
};

creature.cpp  I've cropped away unecessary crap from both these files since they're not even implemented yet, just a bunch of declared variables which are set to default values and not really used for now.  But as you can see it's designed to be constructed with a texture and a specified zone, which is applied in the constructor, and then displayed by reference using the draw function of the app passed by reference.
#include "creature.hpp"

creature::creature(sf::Texture tex, sf::IntRect zone)
{
        // Set texture and zone
        creatureSpr.setTexture(tex);
        creatureSpr.setTextureRect(zone);
}

void creature::draw (sf::RenderWindow& App)
{
        App.draw(creatureSpr);
}

creature::~creature(void)
{
}
 

Output results in an empty 32*32 white opaque rectangle.  Leads me to believe the creatureSpr.setTexture() is failing for some reason, however the setTextureRect appears to work... what's going on? :O

Pages: [1] 2
anything