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

Pages: [1] 2
1
I want automate building SFML. It already works with Visual Studio on Windows. However, on a Ubuntu 14 LTS virtual machine, specifying "SFML_USE_STATIC_STD_LIBS" results in building shared libraries in release mode, regardless of "BUILD_SHARED_LIBS" being set to false. It works fine for debug mode though.

cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=FALSE -DSFML_USE_STATIC_STD_LIBS:BOOL=TRUE
cmake --build . --config Release

What I expected was that SFML would ignore this variable completely here, since it is a Windows only feature. Do I make the wrong call or is this a bug?

2
General / How to integrate SFML's dependencies into my CMake project?
« on: September 14, 2014, 02:35:30 pm »
I use MinGW32 and want to link to SFML statically. This is are the steps I have done.
  • Download official SFML release for MinGW and copied it to D:\lib\SFML-2.1.
  • Set up a CMake project according to this guide.
  • Added set(SFML_ROOT D:/lib/SFML-2.1) to my CMakeLists.txt.
At this step, it compiles and runs fine when I copy all SFML DLLs in the same folder as my executable. However, I want static linking. Therefore, I also added set(SFML_STATIC_LIBRARIES ON) to my CMakeLists.txt. This causes the following error:

Error: SFML found but some of its dependencies are missing ( FreeType GLEW libjpeg OpenAL libsndfile)

So I have to link to all those dependencies myself. On Windows, it is painful to compile them myself. Because of that, it's tempting to use the already compiled dependencies from the SFML repository.

What is the best way to integrate those libraries into my CMake project?

3
General / Need help for compiling on Visual Studio 14 CTP
« on: September 09, 2014, 12:19:10 am »
Hi guys,

I'm trying to use SFML with the newest Visual Studio version, 14 CTP. In order to compile it, I downloaded the newest snapshot from Github and generated project files for Visual Studio 13, which got upgraded on opening. After building the static SFML libraries, I combined them into one library using lib.exe.

The problem is that I get 4 linker errors when I try to compile a simple test program that only creates a sf::RenderWindow.

sfml.lib(jerror.obj) : error LNK2019: unresolved external symbol _fprintf referenced in function _output_message
sfml.lib(jerror.obj) : error LNK2019: unresolved external symbol ___iob_func referenced in function _output_message
sfml.lib(jerror.obj) : error LNK2019: unresolved external symbol _sprintf referenced in function _format_message
sfml.lib(jmemmgr.obj) : error LNK2019: unresolved external symbol _sscanf referenced in function _jinit_memory_mgr

I think the issue is about libjpeg. How can I debug this problem?

4
Feature requests / Why not set sf::Window style at runtime?
« on: September 02, 2014, 10:28:04 pm »
When I create a new window, I can specify whether I'd like a title bar, is resizable, and so on. But I'd like to change that at runtime. This way, I could toggle between windowed mode and fullscreen mode just by removing the window frame and maximizing it. That would allow me to continue using all my OpenGL objects which would get destroyed when recreating the window. Doing this at runtime is possible on Windows and Linux. I don't know about Mac yet.

5
General / Does sf::Context need to be in scope?
« on: March 13, 2014, 09:30:57 am »
I recently implemented a worker thread in my application to upload large vertex buffers to the GPU asynchronously. Therefore, I first tried to just call sf::Context context; as first command in the thread, before entering a loop that calls functions where OpenGL calls are used inside.

void Worker()
{
    sf::Context context;
    while (running) {
        Buffer(); // uses OpenGL calls
    }
}

But I got undefined results. The uploaded meshes were drawn distorted, completely empty, or correct sometimes. So I moved the context creation inside the Buffer() function and that solved my issue.

However, it might be slow to create a new context every time the function gets called, where I only need one. Do I have the pass context object as function parameter to be visible in scope of the function body? Why can't I used it as I first intended?

6
Feature requests / How to find out if window has focus?
« on: April 28, 2013, 06:09:22 pm »
I use the debugging tools of Visual Studio. Therefore my application is run from within the Visual Studio task. Whenever the window of Visual Studio is in background thus hasn't the focus, the window of my application has no focus neither. I guess this is typical behavior of Windows.

Therefore the window of my application sometimes opens with focus and otherwise without. Normally I would track focus changes by sf::Events but since it's created in that state, there is no focus change at all. So I have no chance to check if the window has or hasn't focus, have I?

There should be a function in SFML for fetching the focus state of a window at any time!

7
Feature requests / Basic arithmetic expressions for vector types
« on: March 23, 2013, 12:06:49 pm »
Please implement some operators for SFML's vector types. For example I want to divide a "Vector2i" by a float. I often run into these problems and have to write small helper functions every time. Implementing these operators isn't much effort and would be much more intentional.

The only misunderstanding for my part I can think of is that we aren't supposed to use SFML's vector types ourselves. You you please specify they are only for the interface to SFML or for general usage?

Do you plan to implement these operators?

8
General / Do my framebuffers survive a window recreatation?
« on: March 14, 2013, 05:46:44 pm »
I use SFML to handle window and context creation for me. Since I implemented deferred shading, I make use of many framebuffers. When I recreate the window to switch to fullscreen, I get continuous OpenGL errors.

Do my framebuffers still exists after recreating the window? I do not know much about SFML's internal context handling but I know that for example shader programs are still available after window recreation.

9
Feature requests / Provide scaling for sf::Image
« on: March 09, 2013, 03:14:59 pm »
I would like to see a simple scaling function for sf::Image. This could be done with simple linear or cubic interpolation. Later on there could be a parameter to control the algorithm.

At the moment it is a bit painful to juggle the raw pixel data around in order to perform this task yourself. There was a resize function in older versions of SFML already but that did not actually scale the image. Instead, it added a margin or cut off pixels from the image.

Such a basic task like image scaling should be provided by SFML in my opinion. Could you please give me feedback about this idea?

10
General / Nvidia driver crash at draw call
« on: February 25, 2013, 12:21:39 pm »
I use SFML 2.0 RC for my application and I love it. Some days ago I changed my video card from ATI HD 7870 to NVIDIA GTX 660. From that point on my application stopped working properly.

It crashes at the draw call "glDrawElements" with the following message.
Quote
Unhandled exception at 0x5D9F74E3 (nvoglv32.dll) in Application.exe: 0xC0000005: Access violation reading location 0x00000000.

The first assumption was that there already was a bug in my application the ATI driver tolerated and the new NVIDIA driver does not. In the end of two whole days of debugging I decided to write a new minimal renderer using minimal shaders. But the problem still exists.

There are a few things I want to mention. I use OpenGL version 3.3 with my own shaders and a SFML::RenderWindow for drawing. There are neither compiler errors nor OpenGL errors at runtime. The application simply crashes at the draw call. Other OpenGL applications like third-party games are working on my system. I am using Windows 8 64 and Visual Studio 11 and built static SFML libraries myself. My video card driver is the lastest stable one but I also tried older ones with no success.

11
General / Compile for use of static Runtime Library
« on: February 25, 2013, 11:58:29 am »
I want to embed the runtime library "/MT" instead of "/MD" and therefore I have to build SFML 2.0 RC with the same option. With the graphical interface of CMake I changed all "/MD" options of the configuration to "/MT" and created the project files for Visual Studio 11. I did this once for debug and once for release and built these two projects using Visual Studio 11 once in debug mode and once in release mode.

Both the SFML libraries and my application using it compiled without errors. My question is just if the described procedure is correct. Do I need additional changes or is this the correct way to build SFML with embedded runtime library? I want to be sure to haven't misdo something about the SFML library built because I am haunting a bug in my application.

My system is Windows 8 64 and Visual Studio 11.

12
Graphics / Prepare OpenGL state for SFML drawing
« on: January 21, 2013, 07:52:02 pm »
In my graphics application I use OpenGL calls, vertex buffers and shaders for rendering a scene. Onto that scene I want to draw text using SFML's graphics capabilities. (I use the last SFML 2.0 snapshot and SFML's internaly used GLEW.)

Since SFML internally uses OpenGL for drawing, I need to store the OpenGL state before, reset it for SFML, and restore it afterwards. I know that there is a function called "RenderTarget::pushGLStates()" which first stores the current OpenGL state and resets it to the SFML defaults. But I figured out that this function isn't enough.

Using just the function mentioned above there is no text displayed even if I comment out the draw calls for the scene. (By the way, font loading is successful.)

// draw scene using OpenGL
// ...

// store the state
window.pushGLStates();

// draw text using SFML
Text text("Hello World", font, 15);
window.draw(text);

// restore the state
window.popGLStates();

// display and swap buffers
// ...

Still not drawing scene objects, added the following calls for resetting the OpenGL state, the text is displayed.

// draw scene using OpenGL
// ...

// store the state
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
window.pushGLStates();

// draw text using SFML
Text text("Hello World", font, 15);
window.draw(text);

// restore the state
window.popGLStates();

// display and swap buffers
// ...

But when I enable the scene drawing again, no text is displayed. What of the OpenGL state do I have to reset by myself for displaying text using SFML? Do I have to care about shader uniforms I set for rendering the scene?

13
Window / What is the sense of setView(getView())?
« on: January 21, 2013, 12:26:21 pm »
Debugging my application which uses the last SFML 2.0 snapshot, I stumbled upon a line in RenderTarget.cpp. It reads:

// Set the default view
setView(getView());

Since "getView()" returns "m_view" and "setView()" simply sets "m_view", it the line above make any sense to me.

////////////////////////////////////////////////////////////
void RenderTarget::setView(const View& view)
{
    m_view = view;
    m_cache.viewChanged = true;
}


////////////////////////////////////////////////////////////
const View& RenderTarget::getView() const
{
    return m_view;
}

Could you please explain what this is supposed to do? I am just curious and want to find the bug in my own application.

14
General / How to include the SFML intern GLEW header
« on: January 14, 2013, 05:25:33 pm »
Hello, I am developing a OpenGL application using SFML for some months now.

Since now I used a "sf::Window" and included my own GLEW library and header file to draw OpenGL stuff. Trying to use SFML's two dimensional drawing capabilities (want to draw debug messaged using "sf::Text"), I found out that I have to use "sf::RenderWindow" instead of "sf::Window" because I need "pushGLStates()" and "popGLStates()".

After removing my own GLEW library from the linker includes, I got my project to compile and run as expected. But I am still using my own GLEW header file "#include <GLEW/glew.h>". How can I include the GLEW file shipped with SFML in my own files? What I mean is something like "#include <SFML/.../glew.h>".

The reason that I do not prefer using my own GLEW header file is for consistency and because that might be from another release and version of GLEW. By the way I already included "#include <SFML/OpenGL.hpp>" but that does not provide functions like "glUniformMatrix4fv", "glEnableVertexAttribArray", "glBindBuffer", and others.

It would be nice if there is an easy way to access the SFML internal GLEW header file because that would provide every SFML user the most simple way to directly start developing OpenGL applications without struggling with GLEW. Moreover I heard that beginners ofter fail to properly include GLEW in SFML. So if there is no such feature yet, you might consider implementing that, that would be awesome! Why should GLEW be included multiple times in the same project?

If I am on the wrong path, please tell how I can use both SFML drawing and my own OpenGL drawing. Thanks a lot in advance!

15
Graphics / Image processing capabilities in SFML
« on: January 09, 2013, 03:58:22 pm »
I am using SFML 2.0 for my OpenGL game. For the Minecraft-like cube terrain I use a texture atlas. My problem is that the default mipmap generator interpolates over the boundaries of tiles in the texture atlas. Therefore I need to generate mipmaps on my own.

To generate my own mipmaps which are not interpolated over the edge of tiles, I need some basic impage processing functionality. My question is if my needed functionality is built in in the SFML framework. Otherwise I would need to find an additional library for that purpose.

Image processing functions I need are extracting segments of an image as a new one, inserting there images back into another, larger image and resizing images using linear interpolation. I use the "sf::Image" class for now and would really appreciate continuing using it.

Pages: [1] 2
anything