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

Pages: 1 ... 16 17 [18] 19 20 ... 34
256
While I don't have an answer for the specific problem (I don't know enough about SFML's specific internals) I can offer the 'compromise' to which I came when animating loading screens. The trade off is to load my loading screen resources when the game first starts up, and keep them around for the duration of execution. Then the loading screen/thread launched between states merely animates and draws the resources, having no need to load anything, while the main thread continues to load the new state in the background. This does mean you can't have a loading screen on first start, and that some memory will always be allocated to these resources, but for something small like a rotating icon I find it fast enough to be an acceptable solution.

257
General / Re: Mysterious Regular Frame Stutter
« on: September 23, 2016, 10:43:00 am »
Go to the Nvidia Control Panel and disable "Threaded Optimization". See if that changes anything.

I was having the same problem so I tried this on my work machine (I'd not heard of it before) and it did the trick.

258
Probably with a transform hierachy, where the point of rotation is the root/ parent transform of the two ResctangleShapes

259
General / Re: Problems with Box2D and sfml-tmxloader
« on: August 31, 2016, 10:47:36 am »
I'm not in a position to try the code right now but after a cursory glance the only thing which stands out is that you're not using the unit conversion functions when creating the the player body.

b2PolygonShape playerShape; playerShape.SetAsBox(32, 32);

This is creating a 32 metre by 32 metre box which, in SFML units, is 3200px * 3200px with the default scale, which is pretty big. Box2D is probably trying to force the giant body out when it collides with the rest of the map. If you want your player to be 32px * 32px try

playerShape.SetAsBox(tmx::sfToBoxVec({32.f, 32.f}))

Alternatively if you want a more 'prebaked' solution my game framework xygine has support for tmx maps with box2D physics.

260
Graphics / Re: sprite.move() from my gameobject* is not working
« on: August 14, 2016, 04:06:22 pm »
You're returning copies of the sprite and texture from your game object, so you only update the copy, move it, draw it, then let it go out of scope. Ideally you want to return a reference to your game object members - or even better make game objects drawable and transformable directly (replacing the vertex array with your sprite member).

261
I'm working on a multiplayer game right now, and based on other people's experiences I'm developing it with multiplayer in mind from the outset. When playing locally a server instance is spawned on the machine and the client connects via localhost - this is in fact how games like quake and half-life also work. From there it's much easier to scale up, both by having the server coded seperately so that it can be built more easily in to a stand-alone executable, as well as already having the groundwork laid to connect multiple clients.

262
General / Re: How to fix the CPU hidden symbol linker error?
« on: August 04, 2016, 05:48:19 pm »
The link provides a git patch. Clone the SFML repository using git, download the patch and apply it (the patch modifies the cmake file). Then build the SFML source from the patched repository and install it as usual. Linking against this version of SFML should fix the error.

263
This is the white square problem. addSprite is creating a copy of the texture which is then destroyed when the function exits. Consider using a resource manager for your textures such as the one found in Thor or the SFML game development book.

264
Graphics / Re: Drawing 3D buildings on a 2D tilemap
« on: July 30, 2016, 07:08:14 pm »
This is exactly what my framework xygine does with 3D models. You can create a camera which assumes the 2D portion of your game is on the 0 z-plane by using the height of the viewport and the vertical FOV to calculate the distance the 3D camera would need to be.


265
Graphics / Re: OpenGL is not properly detected on Ubuntu 16.04 VM
« on: July 16, 2016, 03:09:20 pm »
This has been a long running problem for me with various linux distros using Virtualbox (ie several years). I've read many other people also have this problem on the Virtualbox forums, so I switched to VMWare player. So far this works for OpenGL upto 2.1 (so SFML works) but fails with any newer versions of OpenGL - for instance when mixing your own code with SFML which requires a version 3+ context.

266
General / Re: Game menu
« on: July 09, 2016, 11:54:49 am »
The SFML Game Development Book covers both state stacks and UI elements. The source is here (and the book is well worth a read. There's 50% off the digital version).

267
Feature requests / Re: Check if Shader Parameter Exists
« on: July 08, 2016, 08:34:39 pm »
I strongly second this, as it would more easily enable me to map uniform locations to other values, and save on having to do frequent string lookups.

268
Graphics / Re: Heap corruption while freeing memory
« on: June 23, 2016, 11:11:45 pm »
I'm not really sure from the example you've given why it is you even need to heap allocate the font, when stack allocation will probably do. If you really do need to heap allocate your resources take a look at smart pointers.

269
SFML projects / Re: Screenshot Thread
« on: June 21, 2016, 10:55:14 pm »
I've been sitting on this for a while as my artist has gone AWOL



The game itself is pretty complete though - source is here.

270
SFML projects / Re: SFGUI (0.3.0 released)
« on: June 16, 2016, 05:18:50 pm »
Does anyone have a version laying around they can chuck my way? It would be very much appreciated.

This repo has a copy in the include and lib directories.

Pages: 1 ... 16 17 [18] 19 20 ... 34