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

Pages: [1]
1
General / Re: RenderWindow undefined when using XCode templates
« on: June 10, 2013, 02:15:18 am »
Thanks! Found stuff in /usr/local/lib and /usr/local/include. I wasn't expecting stuff in there because I don't remember trying dylibs, but I must've at some point. I also should've spotted the difference in the old and new constructors.

2
General / Re: RenderWindow undefined when using XCode templates
« on: June 07, 2013, 06:20:48 pm »
Switching to release build configuration got rid of the warning.

I tried replacing
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
with
sf::RenderWindow window;
window.create(sf::VideoMode(800, 600), "SFML window");
and that produces this error:

"sf::Window::create(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

And I tried
sf::Image icon=window.capture();
because that function is also in RenderWindow.cpp. It worked fine -- it even gave me a runtime error when I took out the window.create line. I don't know how this can happen. It's as if the constructor and create in RenderWindow.cpp didn't agree with RenderWindow.hpp when the frameworks got made.

3
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.

4
SFML website / Re: SFML 2 RC Mac getting started tutorial
« on: December 07, 2012, 06:23:56 pm »
So, the reason the C++11 part of the tutorial doesn't help (ie why you have 4 threads of the same problem now, and why I'm vindicated in putting this in the website section) is that

1) I'm not using C++11 so I ignored that section. Even if XCode ships with C++11, why would the template you gave me default to C++11 which is NOT what the libraries you gave me work with? If the installer is out of date and hard to update, fine, but it doesn't mean you can't do anything.
2) There's no "if you're getting linker errors look here".
3) There's no mention of libstdc++. You are told how to get C++11 working, not how to get the template working.

So at this point I've got mine, but why not update the tutorial to be a bit more obvious for people who just want to compile the Hello World project by following the alpha path? The headers search path thing should also be in there.

5
SFML website / Re: SFML 2 RC Mac getting started tutorial
« on: December 05, 2012, 07:52:29 pm »
Like so:

Undefined symbols for architecture x86_64:
  "sf::RenderWindow::RenderWindow(sf::VideoMode, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, sf::ContextSettings const&)", referenced from:
      _main in main.o
  "sf::Font::loadFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      _main in main.o
  "sf::Music::openFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      _main in main.o
  "sf::String::String(char const*, std::__1::locale const&)", referenced from:
      _main in main.o
  "sf::Texture::loadFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, sf::Rect<int> const&)", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I assume it's every SFML function called in the template program.

6
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.)

7
Graphics / Re: SFML 2.0 RenderTextures are slow for me
« on: April 28, 2012, 07:47:40 pm »
Hm. So I just learned there's further debug/non-debug in VS -- F5 debugs (whether in release or debug configuration) and ctrl-F5 doesn't. When I use ctrl-f5, the program runs fine.

First time I've seen the program slowed down this way, so I still don't get why the slowing happens, but it's not a big issue.

8
Graphics / Re: SFML 2.0 RenderTextures are slow for me
« on: April 28, 2012, 07:40:42 pm »
I tried both. It's inconsequential. That is, both debug and release run slow from VS, and both run fast when run from outside VS. There's should be very little CPU work here, right?

9
Graphics / Re: SFML 2.0 RenderTextures are slow for me
« on: April 28, 2012, 06:39:52 am »
The plot thickens again -- I ran the executable produced by Visual Studio from outside and it ran much faster.

10
Graphics / Re: SFML 2.0 RenderTextures are slow for me
« on: April 28, 2012, 06:28:41 am »
Doesn't seem to be any obvious gotchas -- it's using hardware.

In particular, I don't think it's the wglMakeCurrent function in WglContext::makeCurrent, which apparently can be slow. I measured it and it takes anywhere from 0 to 4 ms. Which isn't happily fast, but at 60 fps, I get 16 ms per frame (I know I'm doing a hard 16ms delay, but I think it's still a meaningful calculation).

Is it possible that the hardware is that slow? I don't know if I should've said this up front, but the graphics card is integrated. Specs here:
http://support.acer.com/acerpanam/notebook/2009/acer/aspire/Aspire4810TZ/Aspire4810TZsp2.shtml
Just seems stupid to have a hardware implementation of something that's as slow as software though... hm... Hah! It's WAY slower than software. Or whatever I get when I force RenderTextureImplFBO::isAvailable to return false.

I'm going to check out what the default implementation is out of interest, but I'm out of ideas otherwise. Oh, is there a way to profile OpenGL performance so I can be sure of whether or not it's the hardware's fault?

11
Graphics / Re: SFML 2.0 RenderTextures are slow for me
« on: April 28, 2012, 04:58:31 am »
When I got there, RenderTextureImplFBO::isAvailable was already checking for GL_EXT_framebuffer_object only. I stuck in some printfs.

Code: [Select]
bool RenderTextureImplFBO::isAvailable()
{
    ensureGlContext();

    // Make sure that GLEW is initialized
    priv::ensureGlewInit();

    if(GLEW_EXT_framebuffer_object!=0) printf("GLEW_EXT_framebuffer_object!=0\n");
    else printf("GLEW_EXT_framebuffer_object==0\n");
    fflush(stdout);

    return GLEW_EXT_framebuffer_object != 0;
}

And got this output:

Code: [Select]
GLEW_EXT_framebuffer_object!=0
GLEW_EXT_framebuffer_object!=0

Any ideas as to what that means? I'm going to delve into the code a bit.

12
Graphics / Re: SFML 2.0 RenderTextures are slow for me
« on: April 27, 2012, 08:51:56 pm »
Yeah, I'd be happy to help. I'll give it a go tonight. I haven't compiled from source yet, so it might be a little while.

Just to be clear, the goal is to allow SFML 2.0 to use either FBO variation for RenderTexture?

13
Graphics / Re: SFML 2.0 RenderTextures are slow for me
« on: April 27, 2012, 07:08:57 pm »
The computer that runs slow has
Code: [Select]
GL_EXT_blend_minmax
GL_EXT_blend_subtract
GL_EXT_blend_color
GL_EXT_abgr
GL_EXT_texture3D
GL_EXT_clip_volume_hint
GL_EXT_compiled_vertex_array
GL_SGIS_texture_edge_clamp
GL_SGIS_generate_mipmap
GL_EXT_draw_range_elements
GL_SGIS_texture_lod
GL_EXT_rescale_normal
GL_EXT_packed_pixels
GL_EXT_separate_specular_color
GL_ARB_multitexture
GL_EXT_texture_env_combine
GL_EXT_bgra
GL_EXT_blend_func_separate
GL_EXT_secondary_color
GL_EXT_fog_coord
GL_EXT_texture_env_add
GL_ARB_texture_cube_map
GL_ARB_transpose_matrix
GL_ARB_texture_env_add
GL_IBM_texture_mirrored_repeat
GL_EXT_multi_draw_arrays
GL_NV_blend_square
GL_ARB_texture_compression
GL_3DFX_texture_compression_FXT1
GL_EXT_texture_filter_anisotropic
GL_ARB_texture_border_clamp
GL_ARB_point_parameters
GL_ARB_texture_env_combine
GL_ARB_texture_env_dot3
GL_ARB_texture_env_crossbar
GL_EXT_texture_compression_s3tc
GL_ARB_shadow
GL_ARB_window_pos
GL_EXT_shadow_funcs
GL_EXT_stencil_wrap
GL_ARB_vertex_program
GL_EXT_texture_rectangle
GL_ARB_fragment_program
GL_EXT_stencil_two_side
GL_ATI_separate_stencil
GL_ARB_vertex_buffer_object
GL_EXT_texture_lod_bias
GL_ARB_occlusion_query
GL_ARB_fragment_shader
GL_ARB_shader_objects
GL_ARB_shading_language_100
GL_ARB_texture_non_power_of_two
GL_ARB_vertex_shader
GL_NV_texgen_reflection
GL_ARB_point_sprite
GL_EXT_blend_equation_separate
GL_ARB_depth_texture
GL_ARB_texture_rectangle
GL_ARB_draw_buffers
GL_ARB_pixel_buffer_object
GL_WIN_swap_hint
GL_EXT_framebuffer_object
GL_EXT_texture_sRGB
GL_ARB_color_buffer_float
GL_ARB_half_float_pixel
GL_ARB_texture_float
GL_NV_conditional_render
GL_EXT_texture_swizzle

And the computer that runs fast has
Code: [Select]
GL_ARB_color_buffer_float
GL_ARB_compressed_texture_pixel_storage
GL_ARB_conservative_depth
GL_ARB_copy_buffer
GL_ARB_depth_clamp
GL_ARB_depth_texture
GL_ARB_draw_buffers
GL_ARB_ES2_compatibility
GL_ARB_explicit_attrib_location
GL_ARB_fragment_program
GL_ARB_fragment_program_shadow
GL_ARB_fragment_shader
GL_ARB_framebuffer_object
GL_ARB_get_program_binary
GL_ARB_half_float_pixel
GL_ARB_half_float_vertex
GL_ARB_imaging
GL_ARB_internalformat_query
GL_ARB_map_buffer_alignment
GL_ARB_map_buffer_range
GL_ARB_multisample
GL_ARB_multitexture
GL_ARB_occlusion_query
GL_ARB_occlusion_query2
GL_ARB_pixel_buffer_object
GL_ARB_point_parameters
GL_ARB_point_sprite
GL_ARB_provoking_vertex
GL_ARB_robustness
GL_ARB_sampler_objects
GL_ARB_separate_shader_objects
GL_ARB_shader_objects
GL_ARB_shading_language_100
GL_ARB_shading_language_420pack
GL_ARB_shading_language_include
GL_ARB_shadow
GL_ARB_sync
GL_ARB_texture_border_clamp
GL_ARB_texture_compression
GL_ARB_texture_cube_map
GL_ARB_texture_env_add
GL_ARB_texture_env_combine
GL_ARB_texture_env_crossbar
GL_ARB_texture_env_dot3
GL_ARB_texture_float
GL_ARB_texture_mirrored_repeat
GL_ARB_texture_non_power_of_two
GL_ARB_texture_rectangle
GL_ARB_texture_rg
GL_ARB_texture_storage
GL_ARB_texture_swizzle
GL_ARB_timer_query
GL_ARB_transpose_matrix
GL_ARB_vertex_array_bgra
GL_ARB_vertex_array_object
GL_ARB_vertex_buffer_object
GL_ARB_vertex_program
GL_ARB_vertex_shader
GL_ARB_window_pos
GL_ATI_draw_buffers
GL_ATI_texture_float
GL_ATI_texture_mirror_once
GL_S3_s3tc
GL_EXT_texture_env_add
GL_EXT_abgr
GL_EXT_bgra
GL_EXT_blend_color
GL_EXT_blend_equation_separate
GL_EXT_blend_func_separate
GL_EXT_blend_minmax
GL_EXT_blend_subtract
GL_EXT_compiled_vertex_array
GL_EXT_Cg_shader
GL_EXT_depth_bounds_test
GL_EXT_direct_state_access
GL_EXT_draw_range_elements
GL_EXT_fog_coord
GL_EXT_framebuffer_blit
GL_EXT_framebuffer_multisample
GL_EXT_framebuffer_object
GL_EXT_gpu_program_parameters
GL_EXT_multi_draw_arrays
GL_EXT_packed_depth_stencil
GL_EXT_packed_pixels
GL_EXT_pixel_buffer_object
GL_EXT_point_parameters
GL_EXT_provoking_vertex
GL_EXT_rescale_normal
GL_EXT_secondary_color
GL_EXT_separate_shader_objects
GL_EXT_separate_specular_color
GL_EXT_shadow_funcs
GL_EXT_stencil_two_side
GL_EXT_stencil_wrap
GL_EXT_texture3D
GL_EXT_texture_compression_dxt1
GL_EXT_texture_compression_s3tc
GL_EXT_texture_cube_map
GL_EXT_texture_edge_clamp
GL_EXT_texture_env_combine
GL_EXT_texture_env_dot3
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_format_BGRA8888
GL_EXT_texture_lod
GL_EXT_texture_lod_bias
GL_EXT_texture_mirror_clamp
GL_EXT_texture_object
GL_EXT_texture_sRGB
GL_EXT_texture_sRGB_decode
GL_EXT_texture_storage
GL_EXT_texture_swizzle
GL_EXT_timer_query
GL_EXT_vertex_array
GL_EXT_vertex_array_bgra
GL_EXT_import_sync_object
GL_IBM_rasterpos_clip
GL_IBM_texture_mirrored_repeat
GL_KTX_buffer_region
GL_NV_alpha_test
GL_NV_blend_minmax
GL_NV_blend_square
GL_NV_complex_primitives
GL_NV_copy_depth_to_color
GL_NV_depth_clamp
GL_NV_fbo_color_attachments
GL_NV_fence
GL_NV_float_buffer
GL_NV_fog_distance
GL_NV_fragdepth
GL_NV_fragment_program
GL_NV_fragment_program_option
GL_NV_fragment_program2
GL_NV_framebuffer_multisample_coverage
GL_NV_half_float
GL_NV_light_max_exponent
GL_NV_multisample_filter_hint
GL_NV_occlusion_query
GL_NV_packed_depth_stencil
GL_NV_pixel_data_range
GL_NV_point_sprite
GL_NV_primitive_restart
GL_NV_register_combiners
GL_NV_register_combiners2
GL_NV_texgen_reflection
GL_NV_texture_barrier
GL_NV_texture_compression_vtc
GL_NV_texture_env_combine4
GL_NV_texture_expand_normal
GL_NV_texture_lod_clamp
GL_NV_texture_rectangle
GL_NV_texture_shader
GL_NV_texture_shader2
GL_NV_texture_shader3
GL_NV_vertex_array_range
GL_NV_vertex_array_range2
GL_NV_vertex_program
GL_NV_vertex_program1_1
GL_NV_vertex_program2
GL_NV_vertex_program2_option
GL_NV_vertex_program3
GL_NVX_conditional_render
GL_OES_depth24
GL_OES_depth32
GL_OES_depth_texture
GL_OES_element_index_uint
GL_OES_fbo_render_mipmap
GL_OES_get_program_binary
GL_OES_mapbuffer
GL_OES_packed_depth_stencil
GL_OES_rgb8_rgba8
GL_OES_standard_derivatives
GL_OES_texture_3D
GL_OES_texture_float
GL_OES_texture_float_linear
GL_OES_texture_half_float
GL_OES_texture_half_float_linear
GL_OES_texture_npot
GL_OES_vertex_array_object
GL_OES_vertex_half_float
GL_SGIS_generate_mipmap
GL_SGIS_texture_lod
GL_SGIX_depth_texture
GL_SGIX_shadow
GL_SUN_slice_accum
GL_WIN_swap_hint
WGL_EXT_swap_control

In particular, the slow one does have GL_EXT_framebuffer_object.

And in particular, the fast one has:
GL_ARB_framebuffer_object
GL_EXT_framebuffer_blit
GL_EXT_framebuffer_multisample
GL_EXT_framebuffer_object
GL_NV_framebuffer_multisample_coverage
GL_NV_fbo_color_attachments
GL_OES_fbo_render_mipmap

When you say FBO, do you mean GL_ARB_framebuffer_object? Or more?

14
Graphics / Re: SFML 2.0 RenderTextures are slow for me
« on: April 27, 2012, 09:36:29 am »
Tried it on a different computer and it ran much faster. What OpenGL extensions are used by RenderTexture?

15
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]