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

Pages: [1]
1
General discussions / SFML in Android Studio Example
« on: August 30, 2017, 07:30:51 pm »
Hi there,

somewhere around here floats a template to get SFML to work in AndroidStudio.
However, it is quite old, uses the experimental android gradle plugin and uses a dirty hack for SFMLActivity / SFML-Main

I just tried SFML on Android and pushed a new example project, using recent AndroidBuild tools with the newest ndk and AndroidStudio and the stable version of the Android Gradle plugin.

https://github.com/Alia5/SFML_AndroidStudio

I've also encountered a crash when the activity gets sent to the background using the home button, that I've also circumvented without modifying SFML at all.

It also shows how to combine Android-Java code with native-SFML code for things like google-play services etc.

It's still quite ugly and ways to go for a proper "example" project, it should serve as a starting-point, though.
I just wanted to share, I'm sure you can figure it out ;)

2
Window / [HOWTO] Make Transparent SFML Window (on Windows 7+)
« on: November 14, 2016, 03:00:12 am »
It got asked multiple times here in the forums, and I've finally found THE solution after a lot of googeling, and it works like a charm.

I wanted to share this here, so it can be easily found via Google and help other since I didn't find this all too quickly.


With this method, "window.clear(sf::color::transparent);" effectively works like you would expect it.

No setting shapes, no masking, no nothing.

Everything not overlayed with shapes / sprites whatever is fully transparent.
Everything you draw is there, even if it is semi transparent.
Even frigging steam overlay works as you'd might expect!

Screenie:


Code:
https://gist.github.com/Alia5/5d8c48941d1f73c1ef14967a5ffe33d5

3
Hi there,

I have seperate render-class of wich one function runs in a seperate sf::Thread to draw...
In another thread i want to load my textures and sprites, and manipulate them there

So far so good.

but if i want to load a texture, i have to activate the window in the thread i want to load the texture, wich would pause rendering.

so...
Something like this works:
// create the window
//...

//set up the renderclass
Render renderer;
renderer.setwindow.....
...
//load textures and set up sprites...
//copy them into render class
window.setActive(false);
sf::Thread renderthr(&Render::renderthread, &render);   // create our renderer-thread
renderthr.launch();   //start the renderer


and something like this gives me a blank screen and doesn't draw anything
// create the window
//...
window.setActive(false);
//set up the renderclass
Render renderer;
renderer.setwindow.....
...
//load textures and set up sprites...
//copy them into render class
sf::Thread renderthr(&Render::renderthread, &render);   // create our renderer-thread
renderthr.launch();   //start the renderer

i hope this is enough code to explain my problem...
basically something like
renderer.pause(true);
window.setactive(true);
//loadmytexture and create the sprite
//copy the sprity into the rendererclass
window.setactive(false);
renderer.pause(false);
 
would work but that is suboptimal...

4
Graphics / qimage to sf::image conversion
« on: May 25, 2011, 09:22:46 pm »
hi
i need help to convert a qimage to an sf::image...
i just cant get it to work...

yeah, i can read and set every pixel, but you cant read the alpha of an pixel from an qimage :O

5
Hi,
A wrote a basic App that only draws 4 Sprites...
I "killed" 100% CPU usage with "sf::Sleep(0.01);" if thats important somehow...
Well anyways, if I have turned on Windows Aero i get only 0-2 FPS!!!
But if i  turn it off i get high framerates!

I can turn on Aero again after my App was started and FPS stay high, so i think SFML just wont detect my GPU wehn Aero is turned on

So is there any way to "force" SFML to use my GPU?
And if not how to turn off Aero automatically before the SFML Window opens?

Sorry if my english is poor...

Pages: [1]
anything