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

Pages: 1 2 [3] 4 5 ... 12
31
Ok. I don't share that point of view but I have to accept it.

It's probably that I'm used to the way wxWidgets development works.
New, radical changes are made to the new version, but necesary ones are put in both the stable and new branches.

Regards
-Martín

32
Feature requests / Peeking for events
« on: June 18, 2009, 04:21:48 pm »
Yes, good point.

I'll explain what I was trying to do:
I'm working with wxWidgets with the out-of-the-box example in the tutorials.

But having it refreshed on each idle moment kills my CPU and I want to be multitasking; using other software for editing the graphics that I'm using in this one I'm making.

Basically I have an "OnIdle()" derived function that wxWidgets calls when the system is idle. But it actually makes the system go on full load (WinXP).
Maybe it was thought for small timespan processing instead of rendering & buffer swapping, etc.

I will take your approach, but I will still need a way to know if an event ocurred.
I think I will have a flag like "mustRedraw" that gets set on wxWidgets' ProcessEvent() and on the loop that dispatches the SFML events and reset it after RenderWindow::Display()

Just to prove my stubborness: Every other existing window interface has event peeking. :roll:  :P

Thanks for all
-Martín

33
I figured out that could load each file entirely to RAM with standard functions and just load them from there.

This, of course, wouldn't be possible when streaming songs via sf::Music. It would beat the whole point.

Are you abandoning SFML 1.x interface upgrades?
Because I'm cool with having a super-duper SFML2.0, but waiting for it to be stable doesn't solve the lack of key functionality present in SFML1.x.

Of course I don't know how many users it has, as most are not probably actively posting here  :lol:

This is a big interface flaw and, in my opinion, should be adressed in SFML1.x instead of just pushing it with everything else to SFML2.0

* Replacing each string parameter in Load/Save functions with a new sf::filename class that takes either a string or wstring implicitly thru it's constructor could be an easy way of fixing it.
(Converting from string to wstring (ansi to unicode) is locale-charset dependent, so it should be avoided.)

* Loading to RAM and calling LoadFromMemory for unicode strings (except for Music objects) could be a quick way of implementing a new interface.


Best regards
-Martín

34
Needed for files with Unicode characters (e.g. Open a filename in russian, japanese, chinese, etc.)

I'm making an application with SFML+wxWidgets and images will be loaded depending on user input. I can't know beforehand the filenames nor change them.
For now I just copy the image file to an ANSI path (duplicate the file), load it, and delete it... but this is no solution.

I think someone else already asked for this. Sorry if it's repeated, I searched the forum but I don't seem to find it.

Thanks
-Martín

35
Feature requests / Peeking for events
« on: June 17, 2009, 11:54:44 pm »
That it wouldn't get the event out of the queue, allowing it to be processed in another function.

e.g.
Code: [Select]

void Base::OnUpdate() {
    if(wnd.HasPendingEvents())
        ProcessTheEvents();            //virtual
        DrawStuff();                       //virtual
    }
}

void Derived::ProcessTheEvents() {
    Event ev;
    while(wnd.GetEvent(ev)) { /*...*/ }
}


Allows non-centralized processing of events. Gives the ability to process the events in the way that the derived class feels proper (all/some/one per frame)

36
Feature requests / Peeking for events
« on: June 17, 2009, 02:54:07 am »
Is there a function to know if there are any pending window events?

It would be great to avoid constant CPU use for applications that only change their display with user input (like multiple SFML windows integrated in a GUI).

Something like "bool Window::HasPendingEvents();" would be great.

Thanks
-Martín

37
Audio / Audio doesn't fully play[solved]
« on: June 16, 2009, 01:12:25 am »
I think OpenAL32.dll is wrap_oal.dll renamed (as OpenAL Soft readme says you can do to avoid the application loading any other OpenAL driver)

Laurent should be the one to answer to that.

38
Graphics / Wierd "Blurring" with SFML.
« on: June 13, 2009, 01:33:02 pm »
I'm tweaking by code... that could be later be ported to the View lib code.

Try to hack doubles into projections would be a mess (Changing Matrix3 and EVERY part of the code that uses an opengl compatible matrix taken from Matrix3)

I'm trying, but posting through the process is a sort of brainstorm, so anyone else could make a comment and help.


EDIT: Couldn't solve it. I'm dropping it.

The conclusion I reached is that it's probably not related to the precision of the floats.
When you set wider widths (RenderWindow::SetSize and changing the View acordingly), apparently the sprites look wider themselves.
If you narrow it, they tend to get narrower.

It's very noticeable if you change from a width like 800px to one like 300px.

Sprites seem to get their size in relation to the window's size (Either smoothed and non-smoothed ones).
Larger window, larger aspect of sprites. Smaller window, smaller aspect of sprites.

This really bothers me, as I'm making an editor using wxWidgets, and resizing the sfml canvas always changes how sprites are seen!

glHint(GL_PERSPECTIVE_CORRECTION_HINT, xxxxxx) doesn't seem to affect the behaviour.



Well, I hope someone makes this work!
Good luck!
-Martín

39
Graphics / Wierd "Blurring" with SFML.
« on: June 13, 2009, 01:20:35 pm »
Some empirical values...

Code: [Select]
float floatWidth=(float)ns.GetWidth();
double doubleWidth=(double)ns.GetWidth();

volatile float floatPrjWidth=floatWidth;
volatile double doublePrjWidth=doubleWidth;

floatPrjWidth=2.f/floatPrjWidth;
floatPrjWidth=2.f/floatPrjWidth;

doublePrjWidth=2.f/doublePrjWidth;
doublePrjWidth=2.f/doublePrjWidth;


Quote

      floatWidth   482.00000   float
      floatPrjWidth   481.99997   volatile float
      doubleWidth   482.00000000000000   double
      doublePrjWidth   482.00000000000000   volatile double



      floatWidth   457.00000   float
      floatPrjWidth   457.00000   volatile float
      doubleWidth   457.00000000000000   double
      doublePrjWidth   457.00000000000000   volatile double


      floatWidth   373.00000   float
      floatPrjWidth   373.00000   volatile float
      doubleWidth   373.00000000000000   double
      doublePrjWidth   373.00000000000000   volatile double

      floatWidth   419.00000   float
      floatPrjWidth   418.99997   volatile float
      doubleWidth   419.00000000000000   double
      doublePrjWidth   419.00000000000000   volatile double


      floatWidth   439.00000   float
      floatPrjWidth   438.99997   volatile float
      doubleWidth   439.00000000000000   double
      doublePrjWidth   439.00000000000000   volatile double



      floatWidth   237.00000   float
      floatPrjWidth   237.00002   volatile float
      doubleWidth   237.00000000000000   double
      doublePrjWidth   237.00000000000003   volatile double



      floatWidth   209.00000   float
      floatPrjWidth   209.00002   volatile float
      doubleWidth   209.00000000000000   double
      doublePrjWidth   209.00000000000000   volatile double


40
Graphics / Wierd "Blurring" with SFML.
« on: June 13, 2009, 12:50:49 pm »
I think the problem with resizing is that the projection sf::Matrix3 is holding  floats instead of doubles.

The errors could come from rounding under different widths/heights.

Code: [Select]
float a1=2.f/800.f;
float a2=2.f/799.f;
double b1=2.0/800.0;
double b2=2.0/799.0;


Code: [Select]

   a1 0.0024999999 float
   a2 0.0025031290 float
   b1 0.0025000000000000001 double
   b2 0.0025031289111389237 double



somewhat related to this:
http://abepralle.wordpress.com/2009/04/02/iphone-2d-projection-matrix-fpu/

read!
Quote
Finally, after hours of screwing around, I realized I could ditch the floating point-based pixel-to-unit OpenGL ES transformation matrix and do a better job of it myself using doubles instead of floats!


Quote

I was then able to transform pixel coordinates (0..319,0..479) with pixel-perfect accuracy!  Not only that, but it clarified my bitmap text drawing to where I didn’t need any -0.5 translation – in this case, it think the original benefit of -0.5 was more from compensating for floating point error more than it was from compensating for any sort of texel sampling setting.


Bingo!

41
But it's really really really reaaaaally easy to implement.

The only thing to "define" is the interface, as this should be passed to the loading functions (LoadFromFile, LoadFromMemory)

Define that and I can do it (respecting your coding notations)

maybe an extra optional parameter?

like
Code: [Select]
enum FontAntiAliasing {
    AntiAliased,                   //default
    NotAntiAliased
}

42
Really? great.

43
Quote from: "Laurent"

Maybe you can create a patch file, so that this step is reduced to only 2 clicks?


I could try, but there's something creepy about diff'ing microsoft project/solution format.

But I'll do it, thanks

44
I'm requesting the ability to change the rendering mode when loading font glyphs to a texture.
For pixel-based games (i.e. pixellated, "vintage looking", etc.)
As antialiased fonts look bad where everything else is pixelated.

With this parameter, the font's image smoothness should also be disabled (SetSmooth(false))

(this will solve the issue for this other guy in the forum)

"Where to change it":
src\SFML\Graphics\FontLoader.cpp @ 213
Code: [Select]
FT_Glyph_To_Bitmap(&Glyph, FT_RENDER_MODE_NORMAL, 0, 1);

Quote
FT_RENDER_MODE_NORMAL   

This is the default render mode; it corresponds to 8-bit anti-aliased bitmaps.

FT_RENDER_MODE_MONO   

This mode corresponds to 1-bit bitmaps (with 2 levels of opacity).


Example!



Thanks
-Martín

45
Graphics / Wierd "Blurring" with SFML.
« on: June 13, 2009, 09:50:52 am »
Skipped that, sorry.

It's not if you're making a pixelated game (Where smoothed fonts look bad).

Pages: 1 2 [3] 4 5 ... 12
anything