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
16
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.


AlexAUT

17
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:

http://www.dynadream.com/ddweb/index.php/Special_Blog?id=20

AlexAUT

18
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  ;).


AlexAUT

19
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.


AlexAUT

20
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 :)


AlexAUT

21
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)


AlexAUT

22
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});
drawNormalScene(renderTexture);
applyPostProcessing(renderTexture);
window.draw(renderTexture);
//now draw minimap
renderTexture.setSize({320,320});
drawMinimap(renderTexture);
applyBlur(renderTexture);
window.draw(renderTexture);

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



AlexAUT

23
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 ;)


AlexAUT

24
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.


AlexAUT

25
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?


AlexAUT

26
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 = ...;
glUseProgram(prog);

Some hints for the future:

Surround your opengl calls with glGetError() you could have a look at my error handling
https://github.com/AlexAUT/aw/blob/master/include/aw/graphics/core/opengl.hpp#L31
https://github.com/AlexAUT/aw/blob/master/src/aw/graphics/core/opengl.cpp#L20

basically all my opengl calls look like:
GL_CHECK(glClear(...));
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


AlexAUT

27
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  ;)


AlexAUT

28
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?


AlexAUT


29
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)

https://www.sfml-dev.org/tutorials/2.4/graphics-draw.php


AlexAUT

30
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.


AlexAUT

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