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

Pages: [1]
1
Graphics / Re: Drawing to a sf::RenderTexture on separate thread
« on: January 20, 2016, 05:40:32 pm »
I understand that it is difficult but I really want to use Qt for the menus since they are an important part of the game.

My solution is to start a new QThread with it's own sf::Window to show the game world and minimize the menu(-thread) while the game itself is active.

2
Graphics / [Solved] Drawing to a sf::RenderTexture on separate thread
« on: January 18, 2016, 10:54:31 pm »
Hey folks! I'm trying to create a game using sfml and Qt on Windows! I want to separate all the game logic and rendering to a separate QThread and draw the result on a canvas on the main gui-thread. I was hoping I could render the picture in a sf::RenderTexture and signal the texture using Qt:s signal/slot system to the gui-thread. However, the program always crashes with a segmentation fault when calling the sf::RenderTexture::getTexture() in the game-thread. Any ideas? Here's some debug-info:
0       ntdll!RtlReleaseSRWLockShared                   0x77e64d78     
1       ntdll!RtlAllocateHeap                   0x77e62eab     
2       ntdll!RtlAllocateHeap                   0x77e62c0e     
3       ntdll!RtlpNtSetValueKey                 0x77f0d199     
4       ntdll!RtlReleaseSRWLockShared                   0x77e64b10     
5       ntdll!RtlAllocateHeap                   0x77e62eab     
6       ntdll!RtlAllocateHeap                   0x77e62c0e     
7       msvcrt!malloc                   0x77ba7990     
8       libstdc++-6!_Znwj                       0xab372da      
9       (anonymous namespace)::getInternalContext       GlContext.cpp   155     0xa81b35       
10      sf::priv::GlContext::ensureContext      GlContext.cpp   213     0xa81dd6                               
 

Pages: [1]
anything