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

Pages: [1]
1
General / Re: fatal error LNK1181
« on: July 08, 2013, 02:11:32 am »
Wow. Nvm I figured it out. for some reason in the filenames of the dlls they are sfml-graphics-2.lib

apparently that "-2" is very misleading as when I removed the -2 from the project linker/input/additionaldependices list it worked. notice I did not rename the file.

a note should be added in the tutorial  to leave the -2 off. as I put it exactly like the author had it to begin with. but when I went to copy the dlls out of the bin folder I noticed the -2's and went back and added them. thinking it was an oversight on the new naming scheme for 2.0 on the authors part.

2
General / fatal error LNK1181
« on: July 08, 2013, 01:58:05 am »
I'm using visual studios c++ 2010 express edition. I downloaded the Visual C++ 10 (2010) - 32 bits AND Visual C++ 10 (2010) - 64 bits
 

I start a brand new win32 console application. I follow the steps here exactly. http://www.sfml-dev.org/tutorials/2.0/start-vc.php. I have tried using both 32 bit and 64 bit. I am using dynamic dlls and have placed them in the debug and release folders appropriately. but when I try to compile a basically blank program it gives me

1>LINK : fatal error LNK1181: cannot open input file 'sfml-graphics-2.lib'

this is the only code in the program

// teste.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
        return 0;
}

I even tried doing some things not in the tutorial. I added SFML_DYNAMIC to the C++ Optimization. I added The lib and Include paths to the VC++ Directories. I tried flip flopping around incremental linking and link library dependencies. I don't know what else to do.

3
Graphics / Crashes when drawing layers
« on: February 11, 2011, 03:00:54 pm »
thats what i get for coding half asleep.

4
Graphics / Crashes when drawing layers
« on: February 11, 2011, 05:34:51 am »
Code: [Select]
//Main.cpp
#include "stdafx.h"
#include <SFML\System.hpp>
#include <SFML\Window.hpp>
#include <SFML\Graphics.hpp>
#include <string>
#include "Layer.h"
#include <iostream>

int stagew = 1280;
int stageh = 720;
int stagebpp = 32;

int _tmain(int argc, _TCHAR* argv[])
{

Layer lay;
sf::Sprite * spr;
sf::Image ima;
if (ima.LoadFromFile("graphics/tiles.bmp")==true)
std::cout << "good";
spr->SetImage(ima);

lay.push_back(spr);

sf::RenderWindow App(sf::VideoMode(stagew,stageh,stagebpp), "x");

while(App.IsOpened())
{
App.Clear();
App.Draw(lay);// this nor App.Draw((*spr)); will work. they both crash.
App.Display();
}
return 0;
}


why is this crashing?? it post GOOD

here is my layer code

Code: [Select]
#pragma once
#include <vector>
#include <SFML/Graphics.hpp>

typedef std::vector<sf::Drawable*> FrameSet;
typedef FrameSet::const_iterator itFrame;

class Layer : public sf::Drawable, public FrameSet {
 public :
   Layer(  const sf::Vector2f& Position = sf::Vector2f(0, 0),
                const sf::Vector2f& Scale = sf::Vector2f(1, 1),
                float Rotation = 0.f,
                const sf::Color& Col = sf::Color(255, 255, 255, 255));
   virtual ~Layer();

   virtual void Render(sf::RenderTarget& Target) const;
};


Code: [Select]
#include "StdAfx.h"
#include "Layer.h"
#include <iostream>

Layer::Layer(   const sf::Vector2f& Position,
                const sf::Vector2f& Scale,
                float Rotation,
                const sf::Color& Col) :
sf::Drawable(Position,Scale,Rotation,Col)
{
};
 
Layer::~Layer(){
};

void Layer::Render(sf::RenderTarget& Target) const {
    for( itFrame i = begin() ;i!=end();i++)
            Target.Draw(*(*i));
};

5
Graphics / Layers of graphics
« on: December 14, 2010, 06:46:13 pm »
But using the LAYER CLASS you provided.
in the main loop you would have something around

App.Draw(Layer)
App.Display();

meaning every sprite inside the layer will be drawn onto display using Layers post effects/specs Every loop. which is kinda what im wanting but i also didn't want to draw every individual sprite in every loop. instead i was looking to draw the sprites onto the layer once and said layer actually being a seperate sprite that is 1 large image that only has be drawn.  I think im understanding all this correctly. but the Layer class you provided still might be the faster way performance wise thats something im unsure of plus it seems to produce neater code. I will probalby end up using it till i finish the gameplay and start optimizing then make my descision


like to note i found this

http://www.sfml-dev.org/forum/viewtopic.php?t=1686&sid=9c77a66844aa8ba267c176c59a3d8930

after i was having trouble with this line of code

Target.Draw(*i);

noticed it has to be like this instead

Target.Draw(*(*i));


thats straight out of the wiki so they say.

6
Graphics / Layers of graphics
« on: December 14, 2010, 03:01:14 pm »
sounds like the first option would be in the best. but im not sure how taxing it is.

its gonna be for tiles and didn't see the point in redrawing every tile every frame  and thats exactly what the class is doing.

7
Graphics / Layers of graphics
« on: December 14, 2010, 01:58:41 pm »
Render(sf::RenderTarget &target)

Im not really sure what this function is being used for since you showed no example of it being used. would the target not be itself?

8
Graphics / Layers of graphics
« on: December 14, 2010, 06:21:50 am »
I've missed this in the tutorials or its not there. I didn't find what i wanted with the search function either

I want to take several sprites. Draw them on a layer. Then draw that layer onto the screen. I want to be able to move the layer around and it basically moves all the contained sprites. Not sure how this is done with SFML

Pages: [1]
anything