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

Pages: 1 [2] 3 4 ... 27
General / Re: [Android]Use AdMob with SFML
« on: April 07, 2018, 08:07:00 pm »
Your problem is not really related to SFML, so maybe a admob forum would be a better place to ask.

Have you enabled the test ads? iirc real ads are only shown once you deployed your app.


General / Re: [Android]Use AdMob with SFML
« on: April 05, 2018, 06:44:15 am »
It is definitely possible, I did it some time ago based on this tutorial:



System / Re: How to run a function until an event happens
« on: April 03, 2018, 11:39:06 pm »
Keep in mind that there are infinite ways of achieving this, so my suggestion below is just one possibility.

Try to separate initial state, update logic and rendering. Therefore initialize your GUI once (in some init function or constructor of a class...). Then have an update function which will do some fancy animations and than have one render function which draws the current state of GUI.

So you call the init function before the game loop and then call update and render in every frame. This of course does not solve your problem, but now you can use a state machine to switch between different states very easily.
There are a lot of well written tutorial about them, I personally like this one. State machines are really handy for all different kind of problems you will encounter in the future, so invest some time in them it won't be wasted  ;).


General / Re: SFML and QT IDE
« on: March 28, 2018, 09:16:18 pm »
No easy to use project settings UI.

Actually when you create a qmake project you have an UI to add dependencies, where you just have to select the sfml libraries in the filesystem  :D. I'm not sure where exaclty, maybe right click project or under the build tab.


SFML projects / Re: Screenshot Thread
« on: March 18, 2018, 08:23:45 pm »
Two projects I have done for university and now integrated into my engine (using sfml)

Real time rendering engine, technique:
- Mesh loading (obj/collada)
- Particle engine (fire)
- Free flight camera
- Camera paths
- Shadow volumes entirely on the GPU (geometry shader for generating shadow volumes)
- Water (refraction and reflection with a dudv map)


Cloth simulation with VerletIntegration (256x256 grid) implemented in Cuda using a 3-spring model to simulate the behaviour between each particle. Rendertime without recording ~0.8ms.


Will post it into a seperate thread as soon as i release the source code :)


Network / Re: Network code that only works on Local Host...
« on: March 16, 2018, 10:28:54 pm »
But he got some content, just not the expected string? Or do I missunderstand your images?  ???

Have you checked the status of the sockets? (return value of listen/accept/connect/receive/send)


Graphics / Re: sf::RenderTarget::display() not present?
« on: March 16, 2018, 10:24:30 pm »
any response on why there's no setSize()?

Have a look at this example:

//render scene into rendertexture and apply some post processing
renderTexture.setSize({1920, 1080});
//now draw minimap

This code looks fine, we even reuse the rendertexture which should be great, or is it?
This code would perform horribly in comparison to just having 2 rendertextures.

RenderTextures are the heaviest resources SFML does offer (except of the window and maybe sounds?) and setSize() would not express the implications of such a call. It would have to generate at least 1 new texture, 3 at worst. Also what happens to the current content? Scale down/up to the new resolution, clip it at the borders or discard it completely? Copying the content to the new texture may need a copy to userspace and back to the new texture on the GPU...


Network / Re: Network code that only works on Local Host...
« on: March 16, 2018, 10:09:18 pm »
One possible problem: https://en.wikipedia.org/wiki/Endianness . You have to make sure your client and server use the same Endianness or otherwise you have to convert the received/sent data. Maybe you or your friend is using a old mac (power pc)?

Better: just use sf::Packet which takes care of this ;)


General / Re: [Android] Crash when paused
« on: March 08, 2018, 06:42:26 pm »
Then you code has some flaw and we know nothing about it, so it is hard to help you  ;).

Try to remove parts of the code until the problem disappears, thats the only advice I can give in this situation.


General / Re: [Android] Crash when paused
« on: March 06, 2018, 08:26:31 pm »
Does the provided SFML example show the same behaviour on your phone?


Window / Re: Issues with window initializing using sf::ContextSettings
« on: March 03, 2018, 11:18:27 pm »
You forgot to "bind"/use the shader  ;D

prog = ...;

Some hints for the future:

Surround your opengl calls with glGetError() you could have a look at my error handling

basically all my opengl calls look like:
and when an error occurs an exception is thrown.

And have a look at some opengl debug tools. I can highly recommend this one. It has a nice GUI where you can jump between frames and have a look at the context state (active shaders / textures / framebuffers...) at every opengl call  :D


Graphics / Re: [SOLVED] window.draw(sprite) White Screen
« on: March 03, 2018, 01:24:35 pm »
Happens to all of us from time to time  ::).

Placing the clear/draw/display into the event loop (pollEvent) is another common misstake  ;)


Window / Re: Issues with window initializing using sf::ContextSettings
« on: March 03, 2018, 01:21:54 pm »
I just skimmed over your opengl code and it looks fine so here are some guesses:

1) sf::RenderWindow does alter the state of the context after creation, so try to call window.resetGLStates() after the creation of the window.

2) Try to use a sf::Window instead of the sf::RenderWindow, since you use a 3.3 core context the graphics module of SFML won't work anyways. The sf::Window won't touch your contenxt  ;)

3) Shader code correct?


Graphics / Re: window.draw(sprite) White Screen
« on: March 03, 2018, 11:15:43 am »
Have a look at the first code snippet and look closely where draw(), clear() and display() are called ;) (inside or outside of the isOpen() loop)



Graphics / Re: button error
« on: February 10, 2018, 09:34:21 pm »
when reading at 0x0000000000000000.

As a developer this should already give you an explanation of your crash. Spoiler: you are accessing a null pointer (it points to 0 in memory). So start your application with a debugger and you will find the cause of the crash easily.

Also from just flying over your code, you are using the heap when there is no need for it (new/delete). You should really train your basic C++ before you write multimedia applications or games.


Pages: 1 [2] 3 4 ... 27