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.


Topics - zuon

Pages: [1]
1
General / RenderWindow undefined when using XCode templates
« on: June 07, 2013, 01:41:14 am »
I decided it was time to try to get up to date with SFML 2.0. So I went here
http://www.sfml-dev.org/tutorials/2.0/start-osx.php

I paid special attention to the C++11 stuff because it caused trouble in the release candidate. I don't really care whether I use C++11 or not, I just want to do the easiest thing. Sounds like I need to avoid C++11 to avoid compiling, so not using C++11 is easier.

So I went through the next section. The first step was to go to the downloads page
http://www.sfml-dev.org/download/sfml/2.0/
and... I thought I didn't have to compile for C++11 to work? Why is there a C++11 option here? Oh well, I'll go with the one that's on top because it's probably easier. I copy the stuff, getting confused for a second because the SFML folder was hidden in the templates folder.

I move on. Create a new SFML App. Select the things in the picture. The next steps mock me, because my project is not ready. It is telling me

cc1objplus: warning: -Wuninitialized is not supported without -O

and probably more importantly

Undefined symbols for architecture x86_64:
  "sf::RenderWindow::RenderWindow(sf::VideoMode, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, sf::ContextSettings const&)", referenced from:
      _main in main.o

The "read before posting" thread mentions searching the forum. I kept getting slow search times and database errors. I think just Googling this domain is a better idea.

The same thread also mentions removing old versions of SFML. I wish I knew what I did when I installed the SFML 2.0 RC. But I can't find the older version of the tutorial to help figure out what I did, and in any case I tried a bunch of different things when then C++11 shit hit the fan. I can only hope that the things I need to do for SFML 2.0 are the only things that could affect it.

I'm using Mac OS X 10.7.5 and XCode 4.5.1.

I realize I'm overdramatacizing my experience. I'm glad you guys made this library in your spare time and let me use it and support it in the forums. I figure if you're willing to do those things, you might have an interest in what it's like to be a user. So empathize with me if you have such an interest -- pretend this isn't your library, and get frustrated with me. And if you don't, forget about the dramatic bits.

2
SFML website / SFML 2 RC Mac getting started tutorial
« on: December 04, 2012, 07:30:18 pm »
On this page:
http://www.sfml-dev.org/tutorials/2.0/start-osx.php
following the (suggested) instructions does not lead to success -- it gives the error "'SFML/Graphics.hpp' file not found" when compiled. So I googled some:
https://github.com/SFML/SFML/issues/233
Adding /Library/Frameworks to the "Framework Search Path" in the target's Build Settings gets rid of the "'SFML/Graphics.hpp' file not found" error. (I'm not sure if this is the correct place to put it though). But then I get undefined symbols from the linker. I can't find a place to put /usr/local/include and /usr/local/lib that makes it work. I tried "Header Search Paths" and "Library Search Paths" respectively. The problem seems to be fixed on your end, but what am I supposed to do? I don't know where to plop in the new version of the template, I don't know what to change in my project, I can't just download a newer installer, and any sane person is going to move to a different library before they do anything complicated to get the Hello World program working.

So please update the tutorial page to include fixes that can't be put in an installer.

(PS: from what I googled, I'm thinking this problem isn't unique to me. But if it is, this post is obviously in the wrong spot, and I'm willing to spend some time figuring out what the solution is.)

3
Graphics / SFML 2.0 RenderTextures are slow for me
« on: April 27, 2012, 09:06:22 am »
Hi, new to SFML. Whipped this up (SFML 2.0)...

Code: [Select]
#include <iostream>
#include <cmath>

#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>

using namespace std;

int main(){
//create a window
///sf::RenderWindow window(sf::VideoMode(640, 480, 32), "test", sf::Style::Close|sf::Style::Fullscreen);
sf::RenderWindow window(sf::VideoMode(640, 480, 32), "test", sf::Style::Close);
//textures
sf::Texture sceneTexture, lightTexture;
sceneTexture.loadFromFile("scene.png");
lightTexture.loadFromFile("light.png");
//sprites
sf::Sprite sceneSprite, lightSprite;
sceneSprite.setTexture(sceneTexture);
lightSprite.setTexture(lightTexture);
//render textures
sf::RenderTexture scene, light;
scene.create(window.getSize().x, window.getSize().y);
light.create(window.getSize().x, window.getSize().y);
//clock
sf::Clock clock;
//render states
sf::RenderStates add, multiply;
add=sf::RenderStates::Default;
add.blendMode=sf::BlendAdd;
multiply=sf::RenderStates::Default;
multiply.blendMode=sf::BlendMultiply;
//loop
while(window.isOpen()){
sf::Event sfEvent;
while(window.pollEvent(sfEvent))
switch(sfEvent.type){
case sf::Event::Closed: window.close(); break;
case sf::Event::KeyPressed:
if(sfEvent.key.code==sf::Keyboard::Q) window.close();
break;
default: break;
}
lightSprite.setOrigin(sin(clock.getElapsedTime().asSeconds())*100+50, 0);
scene.clear();
light.clear();
scene.draw(sceneSprite);
light.draw(lightSprite, add);
scene.display();
light.display();
window.clear();
window.draw(sf::Sprite(scene.getTexture()));
window.draw(sf::Sprite(light.getTexture()), multiply);
window.display();
sf::sleep(sf::seconds(1/60.0f));
}
//finish
return 0;
}

Found clearing, drawing, and displaying RenderTextures was very slow and processor intensive. Is there a faster way to do this? Is my computer lacking and the rendering being done in software? Do I need to wait for kinks to be sorted out?

Code and images available here:
http://dl.dropbox.com/u/67501358/zuon.zip

Pages: [1]