Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED] SFML 1.2 RC  (Read 35938 times)

0 Members and 1 Guest are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[SOLVED] SFML 1.2 RC
« Reply #30 on: January 02, 2008, 02:15:43 am »
Quote
One problem I noticed so far is the following output on std::cerr when my application is closing. But please note that this is only happening in Debug mode, not in Release mode, and I have not investigated it further yet.

That's weird, I'm going to check this. It doesn't appear in release mode because no checking is done on OpenGL functions ;)

Quote
Regarding compilation of SFML: here's the build log, stripped by the "everything is fine" parts:
(note: I neither have Qt no wxWidgets installed)

Everything looks ok.

Quote
The postfx and postfx-d examples start and even show some of the effects, but when I switch to other effects the application totally freezes

Which effects ? What is our graphics card ?

Quote
/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../libsfml-graphics.so: undefined reference to `sf::Image::GetTexCoords(sf::Rect<int> const&) const'
collect2: ld returned 1 exit status

I've added an optional parameter to this function, try a complete rebuild ;)
Laurent Gomila - SFML developer

T.T.H.

  • Full Member
  • ***
  • Posts: 112
    • View Profile
[SOLVED] SFML 1.2 RC
« Reply #31 on: January 03, 2008, 03:21:31 pm »
Effect "nothing" works, looks like this.

Effect "wave" works, looks like this.

Effect "fisheye" runs but without any visual change, looks like this.

Effect "colorize" works, looks like this.

Effect "blur" (at least I guess it's the effect "blur") freezes instantly when I switch to it, showing the last visible image from the last effect. The call stack in the debugger tells me something about "NTDLL.DLL" and "atioglxx.dll" but not more.

I do have ATI Radeon 9800 Pro from Sapphire with 128 MB Ram on 400 Mhz running with a ATI Catalyst 4.4 driver version 6.14.0010.6436 on Windows 2000 SP 4. Obviously the Catalyst is pretty old (April 2004) but pretty stable so far (regarding games).

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[SOLVED] SFML 1.2 RC
« Reply #32 on: January 03, 2008, 03:28:59 pm »
Some effects are not supported, depending on which GLSL version is supported by your card. Your results are consistent with that.
Laurent Gomila - SFML developer

T.T.H.

  • Full Member
  • ***
  • Posts: 112
    • View Profile
[SOLVED] SFML 1.2 RC
« Reply #33 on: January 03, 2008, 09:09:07 pm »
Ugh - how can I find out which version of GLSL my card supports?

Whether or not, it would be quite nice if the postfx.exe application would tell me something like "your graphic card can't display that effect" instead of just plain freezing up.

omgfairies

  • Newbie
  • *
  • Posts: 1
    • View Profile
[SOLVED] SFML 1.2 RC
« Reply #34 on: January 03, 2008, 11:50:28 pm »
Strange, tried out the postfx.exe and all except waves works.
Got a newer card ATI Radeon X1900GT, kinda strange it works on older card but not on a newer.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[SOLVED] SFML 1.2 RC
« Reply #35 on: January 04, 2008, 03:01:46 am »
Quote
Ugh - how can I find out which version of GLSL my card supports?

Whether or not, it would be quite nice if the postfx.exe application would tell me something like "your graphic card can't display that effect" instead of just plain freezing up.

It's not straight-forward. Basically, with GLSL everything is done by the driver, which means the shader system is very flexible. But this flexibility also means there's no strong versioning system. For example, I can't force the shaders to be compiled in GLSL 1.1, or check which subset of 1.1 instructions is supported by your system.

However, I'll investigate more on this and see if I can find a way to make the system more robust.

Quote
Strange, tried out the postfx.exe and all except waves works.
Got a newer card ATI Radeon X1900GT, kinda strange it works on older card but not on a newer.

Do you have the latest driver for your graphics card ?
Laurent Gomila - SFML developer

zarka

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
[SOLVED] SFML 1.2 RC
« Reply #36 on: January 05, 2008, 11:32:45 pm »
it seams like the sf::String isn't freeing up its resources as it should

i tried running this code in visual studio 2005

Code: [Select]

#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>

#include "SFML/Graphics.hpp"

int main()
{
// Create the main window
sf::RenderWindow App(sf::VideoMode(800, 600), "SFML test", sf::Style::Close, 4);
App.ShowMouseCursor(true);

// Create a graphical string to display
sf::String Text("Hello SFML", "arial.ttf", 32);
Text.Move(265, 50);
Text.SetColor(sf::Color(255,0,0));

// Start the game loop
bool Running = true;
while (Running)
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
Running = false;
if(Event.KeyPressed && Event.Key.Code == sf::Key::Escape)
Running = false;
}
// Draw the string
App.Draw(Text);

// Update the window
App.Display();
}
//Tell Visual studio to dump memory leaks
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
_CrtSetReportMode ( _CRT_ERROR, _CRTDBG_MODE_DEBUG);
return 0;
}


and got this in the output window
Quote

Detected memory leaks!
Dumping objects ->
{3770} normal block at 0x018B2470, 320 bytes long.
 Data: <                > E4 AC AC AC AC AC AC AC AC AC AC AC AC AC AC E4
{3769} normal block at 0x018B2400, 52 bytes long.
 Data: <  = 4 \ stib    > 08 D2 3D 00 34 14 5C 00 73 74 69 62 00 00 18 00
{3761} normal block at 0x018B2158, 320 bytes long.
 Data: <                > E4 AC AC AC AC AC AC AC AC AC AC AC AC AC AC E4

and so on for a long long while...

i investigated further using Visual Leak Detector (http://dmoulding.googlepages.com/vld) and it seamd to originate in the FontManager. i tried linking with the 1.1 version and then i did not get any leaks.

Edit:
if i remove the mApp.Draw(Text) i do not get any leaks so it seams to perhaps be in the Rendering code ?
//Zzzarka

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[SOLVED] SFML 1.2 RC
« Reply #37 on: January 06, 2008, 05:06:08 am »
Thanks for the leak report, I'l try to find and fix it.
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[SOLVED] SFML 1.2 RC
« Reply #38 on: January 06, 2008, 09:34:45 am »
All the font leaks have now been fixed, thanks for your help. And thanks for telling me about Visual Leak Detector, which I didn't know ;)
Laurent Gomila - SFML developer

Aszarsha

  • Full Member
  • ***
  • Posts: 200
    • MSN Messenger - aszarsha@gmail.com
    • View Profile
[SOLVED] SFML 1.2 RC
« Reply #39 on: January 06, 2008, 10:12:19 am »
Quote from: "Laurent"
And thanks for telling me about Visual Leak Detector, which I didn't know ;)
Same here, thanks ! :)

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
[SOLVED] SFML 1.2 RC
« Reply #40 on: January 06, 2008, 01:01:13 pm »
Quote from: "Aszarsha"
Quote from: "Laurent"
And thanks for telling me about Visual Leak Detector, which I didn't know ;)
Same here, thanks ! :)

ditto

zarka

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
[SOLVED] SFML 1.2 RC
« Reply #41 on: January 06, 2008, 03:23:34 pm »
Quote from: "Laurent"
All the font leaks have now been fixed, thanks for your help.

Excellent! I have now updated and i can't se any leaks.

Quote from: "Laurent"
And thanks for telling me about Visual Leak Detector, which I didn't know ;)

Quote from: "Aszarsha"
Same here, thanks ! :)

Quote from: "dabo"
ditto

your welcome. it's a quite handy tool :)
//Zzzarka

zarka

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
[SOLVED] SFML 1.2 RC
« Reply #42 on: January 06, 2008, 07:33:03 pm »
Ther seams to be another memory leak in the Audio package.

Code: [Select]

#include "SFML/Graphics.hpp"
#include "SFML/Audio.hpp"
#include "vld.h"
int main()
{
// Create the main window
sf::RenderWindow App(sf::VideoMode(800, 600), "SFML test", sf::Style::Close, 4);
App.ShowMouseCursor(true);

sf::Music mus();
mus.Open("sidlek.ogg");

mus.Play();
// Start the game loop
bool Running = true;
while (Running)
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
Running = false;
if(Event.KeyPressed && Event.Key.Code == sf::Key::Escape)
Running = false;
}
// Update the window
App.Display();
}
}


with this code VLD reports 6 leaks originating in sf::Music class. seams to be some memory allocated by SoundFileOgg that doesn't get released.
//Zzzarka

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[SOLVED] SFML 1.2 RC
« Reply #43 on: January 07, 2008, 02:44:55 am »
Quote
with this code VLD reports 6 leaks originating in sf::Music class. seams to be some memory allocated by SoundFileOgg that doesn't get released.

Ok, I'll check this.
Laurent Gomila - SFML developer

T.T.H.

  • Full Member
  • ***
  • Posts: 112
    • View Profile
[SOLVED] SFML 1.2 RC
« Reply #44 on: January 08, 2008, 08:24:28 pm »
Hi there


Regarding the sample program "postfx.cpp":

While loading the effects...
Code: [Select]
// Load all effects
std::map<std::string, sf::PostFX> Effects;
Effects["nothing"].LoadFromFile("datas/post-fx/nothing.sfx");
Effects["blur"].LoadFromFile("datas/post-fx/blur.sfx");
Effects["colorize"].LoadFromFile("datas/post-fx/colorize.sfx");
Effects["fisheye"].LoadFromFile("datas/post-fx/fisheye.sfx");
Effects["wave"].LoadFromFile("datas/post-fx/wave.sfx");
std::map<std::string, sf::PostFX>::iterator CurrentEffect = Effects.find("nothing");

...no return value is checked. For a sample application where you want to know "is that effect working for me?" not a good solution (in my humble opinion).

In addition postfx.exe is no console application and so I initially didn't see any errors because std::cerr gets displayed nowhere. I had to reroute std::cerr into a file so see what is actually happening.


Regarding the effect "fisheye":

When running postfx.exe I do get the following message when loading the effect "fisheye":
Code: [Select]
Failed to compile effect :
ERROR: 0:5: '*' :  wrong operand types  no operation '*' exists that takes a left-hand operand of type 'float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:7: '<' :  wrong operand types  no operation '<' exists that takes a left-hand operand of type 'float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 2 compilation errors.  No code generated.

That seems to be the reason why there is no visual result on the screenshots I posted earlier.


Regarding the effect "blur":

It loads and compiles without any problems but then it simply freezes the whole application - and I don't know why.

At the end I don't really care since I am far, far away from using any shaders, but in case you (Laurent) want this resolved before you declare the "RC version" as "stable" I would dig deeper into the problem.


Regarding my GLSL version:

With the help of the tool "GPU Caps Viewer v1.4.0" from "oZone3D" (which can be found here) I figured out that my version of GLSL is...

...none?!? For some weird reason the tool tells me "GLSL Version: Not Supported" :(

Here's the full info dump (sorry, it's long, but I didn't want to cut off any details that might be important). After reading this anybody has a clue why "fisheye" isn't compiled correctly and why "blur" crashes?

Code: [Select]
===================================[ OpenGL GPU Capabilities ]
- OpenGL Version: 1.5.4273 Win2000 Release
- GLSL (OpenGL Shading Language) Version: Not Supported
- ARB Texture Units: 8
- Vertex Shader Texture Units: 0
- Pixel Shader Texture Units: 16
- Geometry Shader Texture Units: 0
- Max Texture Size: 2048x2048
- Max Anisotropic Filtering Value: X16.0
- Max Point Sprite Size: 0.0
- Max Dynamic Lights: 8
- Max Viewport Size: 4096x4096
- Max Vertex Uniform Components: 0
- Max Fragment Uniform Components: 0
- Max Varying Float: 0
- Max Vertex Bindable Uniforms: 0
- Max Fragment Bindable Uniforms: 0
- Max Geometry Bindable Uniforms: 0
- Frame Buffer Objects (FBO) Support:[no]
- Multiple Render Targets / Max draw buffers: 4
- Pixel Buffer Objects (PBO) Support:[no]
- S3TC Texture Compression Support:[yes]
- ATI 3Dc Texture Compression Support:[no]
- Texture Rectangle Support:[yes]
- Floating Point Textures Support:[yes]
- MSAA: 2X
- MSAA: 4X
- MSAA: 6X
- OpenGL Extensions: 97 extensions
   - GL_ARB_multitexture
   - GL_EXT_texture_env_add
   - GL_EXT_compiled_vertex_array
   - GL_S3_s3tc
   - GL_ARB_depth_texture
   - GL_ARB_fragment_program
   - GL_ARB_multisample
   - GL_ARB_occlusion_query
   - GL_ARB_point_parameters
   - GL_ARB_shadow
   - GL_ARB_shadow_ambient
   - 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_mirrored_repeat
   - GL_ARB_transpose_matrix
   - GL_ARB_vertex_blend
   - GL_ARB_vertex_buffer_object
   - GL_ARB_vertex_program
   - GL_ARB_window_pos
   - GL_ATI_draw_buffers
   - GL_ATI_element_array
   - GL_ATI_envmap_bumpmap
   - GL_ATI_fragment_shader
   - GL_ATI_map_object_buffer
   - GL_ATI_separate_stencil
   - GL_ATI_texture_env_combine3
   - GL_ATI_texture_float
   - GL_ATI_texture_mirror_once
   - GL_ATI_vertex_array_object
   - GL_ATI_vertex_attrib_array_object
   - GL_ATI_vertex_streams
   - GL_ATIX_texture_env_combine3
   - GL_ATIX_texture_env_route
   - GL_ATIX_vertex_shader_output_point_size
   - GL_EXT_abgr
   - GL_EXT_bgra
   - GL_EXT_blend_color
   - GL_EXT_blend_func_separate
   - GL_EXT_blend_minmax
   - GL_EXT_blend_subtract
   - GL_EXT_clip_volume_hint
   - GL_EXT_draw_range_elements
   - GL_EXT_fog_coord
   - GL_EXT_multi_draw_arrays
   - GL_EXT_packed_pixels
   - GL_EXT_point_parameters
   - GL_EXT_rescale_normal
   - GL_EXT_secondary_color
   - GL_EXT_separate_specular_color
   - GL_EXT_shadow_funcs
   - GL_EXT_stencil_wrap
   - GL_EXT_texgen_reflection
   - GL_EXT_texture3D
   - 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_lod_bias
   - GL_EXT_texture_mirror_clamp
   - GL_EXT_texture_object
   - GL_EXT_texture_rectangle
   - GL_EXT_vertex_array
   - GL_EXT_vertex_shader
   - GL_ARB_shading_language_100
   - GL_ARB_shader_objects
   - GL_ARB_vertex_shader
   - GL_ARB_fragment_shader
   - GL_HP_occlusion_test
   - GL_NV_texgen_reflection
   - GL_NV_blend_square
   - GL_NV_occlusion_query
   - GL_NV_point_sprite
   - GL_ARB_point_sprite
   - GL_SGI_color_matrix
   - GL_SGIS_texture_edge_clamp
   - GL_SGIS_texture_border_clamp
   - GL_SGIS_texture_lod
   - GL_SGIS_generate_mipmap
   - GL_SGIS_multitexture
   - GL_SUN_multi_draw_arrays
   - GL_WIN_swap_hint
   - WGL_EXT_extensions_string
   - WGL_EXT_swap_control
   - WGL_ARB_extensions_string
   - WGL_ARB_make_current_read
   - WGL_ARB_multisample
   - WGL_ARB_pbuffer
   - WGL_ARB_pixel_format
   - WGL_ARB_render_texture
   - WGL_ATI_pixel_format_float