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

Pages: [1] 2
1
Okay, I understand. I thought that the draw() method was only a sequence of, well actually drawing stuffs, but if it alters GL states then it's not going to work.

I will create my own macros then, thanks for the help.

2
Okay I see. I could use SFML's window system but I need to be able to switch contexts (like  glXMakeContextCurrent) because in the already existing app there is one made for 2D rendering and one made for 2D and 3D rendering (it's for compatibility purpose, for example if you don't have graphics acceleration).

And would there be a way to only use the drawing methods of the SFML components ? I can handle gl states myself (the app already does), I only would like to draw shapes, sprites and fonts in a more convenient way.

3
But it breakes when I create the rendertexture, I can't even use the pop and push methods =/ (or I'll push a black screen, yay)

4
Graphics / Using SFML built-in rendering methods in another context
« on: May 07, 2015, 08:12:46 pm »
Hello,

I would like to know if it would be possible to use only the drawing methods of the SFML components ? The point is to use them in another context that an SFML window ? It's actually a raw glx window with some options like a depth and stencil buffer and some already existent drawing methods in 2D and 3D.

The point would be to draw SFML things on the top of what is already in the window (which is not my code). I've tried to create a RenderTexture but it obviously breaks everything (black screen and GL error, oops), because I guess it tempers with gl states and nothing can be drawn.

Could you help me ?
Thanks !

5
Audio / Re: SoundStream for real-time audio
« on: May 01, 2015, 09:08:12 pm »
Nevermind, I did it using ALSA and a separate thread, it works well. You can delete or lock this thread if you want to :)

6
Audio / SoundStream for real-time audio
« on: May 01, 2015, 03:02:19 pm »
Hello,

In my project I need to be able to play "real time" sound (approx. 1100 samples per frame, at approx. 30fps). I tried the SoundStream class you provide ; it works, but the onGetData is not fast enough because I need to create a fifo queue and push/pop my samples while waiting for the stream to require them. The result is a late audio compared to the video (it's supposed to be syncd) ; from time to time there is a little throttle and it gets late, the more I play the more it's late.

So here is my question : how could I fix that ? I think that I need to edit SoundStream to make it a push-based system instead of a pull-based. Instead of requiring the chunks every times needed, it lets me fill the buffers on my own (at each frame). There would be no more need for a fifo queue and I think it would be fast enough and more synchronized.

Could you help me ?

Thanks !

7
I confirm that it works for a fullscreen app, I only tried a moving rectangle for now so I don't know how the performances are, I'll try to compile my true project as soon as I can get a working Qt SDK on the rasp.

8
Would there be a way to automatize the scaling for every component drawn, or do I need to scale each one "by hand" ?

9
I talked with a friend (who is a Minecraft modder) and he told me that Minecraft uses a technique to scale to every resolution ; it creates a new ortho which units is either wider or smaller than an actual pixel (depending on the resolution), and then scales everything according to it (by tweaking glOrtho). That means that you now have to draw your stuff using a specific unit, and it works quite well.

Would that be possible to do using SFML ?

10
Like creating a components system with some layouts (like Swing) and stuff ? I was planning to make some components but creating a layout system is quite heavy, isn't it ?

11
I'm actually making a console-like GUI for a Raspberry Pi (only the GUI). It includes a profile system, a game library, etc.

So I think that the best solution is to adapt every single component to the actual screen, like saying that the top bar is 1/14 of the screen, the font size is the top bar height minus some pixels for the padding etc...

But I honestly think that there is a better solution, it would be quite a pain to create everything like this.

12
Hello,

I'm using VideoMode::getFullscreenModes() to get the best fullscreen videomode for my game, but I don't really know what is the proper way to draw my things, knowing the window size.

Let's take an example : I want to draw a bar at the top of the screen, with some text at its left, middle and right. It takes the whole screen width. On my screen, I decided that a 30px height and 16px font was fine, buuuut... on some screens, it may be too large and on some screens it may be too small (the goal is to target a TV, so obviously 30px is ridiculous).

So my question is : what is the proper way to adapt this ? Should I pick a standard resolution and scale to it, and adding black bars ? Or scaling each UI component ? But how ?

Thanks ^^

13
System / Re: Xbox 360 controller left and right triggers
« on: April 09, 2015, 10:22:25 am »
Which ones ? The POV is the DPAD, the XYZ is the left joystick and the RUV is the right joystick, isn't it ?

Oh I see now, it's POV, XY, ZR and UV... thanks ^^

14
System / Xbox 360 controller left and right triggers
« on: April 09, 2015, 09:14:28 am »
Hello,

I'm trying to use a wired Xbox 360 controller with SFML (on Linux) ; everything works perfectly (the 11 buttons + the dpad + the two joysticks) except that the left and right triggers are not recognized as buttons, so... I don't know how to use them.

Am I doing it wrong, is there a special way to use them or should I use another thing such as XInput or xboxdrv ?

Thanks !

15
I'll give it a try, I'll let you know the results

Pages: [1] 2
anything