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

Pages: 1 [2] 3 4 ... 15
16
Graphics / RenderTexture Speed
« on: October 09, 2011, 04:49:34 pm »
Ah I misunderstood his question.  I thought he meant drawing to a RenderTexture, not creating it.

17
Graphics / RenderTexture Speed
« on: October 09, 2011, 08:44:54 am »
It all resides in video memory so I wouldn't imagine it'd be much slower than normal rendering.

Only way to know for sure, though, would be to try it out.

18
Feature requests / sf::Vector2 Empty value
« on: October 05, 2011, 04:59:32 pm »
You can implement your own.

Make a constant vector and give it NaN for x,y components.

Though I agree with Laurent, not necessary for SFML.

19
SFML projects / Airport
« on: October 05, 2011, 04:12:50 am »
Every once in a while the sound effects just stop and I have to restart the program to get them going again.

Also you should lower the music volume or give an option to turn it off.  I need to hear the sfx, but the music is driving me nuts.

Also got to 100!

EDIT:  also, more than a few times my planes didn't land on the runway even though they should have  =(

20
SFML projects / Airport
« on: October 04, 2011, 04:28:43 pm »
This is pretty awesome.  Surprisingly difficult!

I like the graphics, too.

EDIT:  I got to 72!

21
Graphics / Release SF::image resource
« on: October 04, 2011, 06:35:55 am »
Code: [Select]
image.Create(0,0); might work.  If not, then
Code: [Select]
image.Create(1,1);

22
General / A very strange case of flickering
« on: October 03, 2011, 12:49:26 am »
S'all good.  At least you didn't delete your post after you got a solution.  That issue plagues another forum I frequent.

23
General / A very strange case of flickering
« on: October 02, 2011, 06:21:21 pm »
I don't think that was ever courtesy.  It just prevents other people from contributing.  No harm in leaving the thread open just in case.  If nobody has anything to contribute, they won't post so it'll have the same effect.

24
General / A very strange case of flickering
« on: October 02, 2011, 12:55:46 am »
Quote
Mod, please lock this thread


??  why?

25
General discussions / Is there an SFML Mario tutorial?
« on: September 29, 2011, 05:01:53 pm »
Motion is very simple.   Just keep an X and Y velocity which add to the object's position every frame.

Code: [Select]

void Mario::Update()
{
  // assume velocity is a sf::Vector2f

  // jump
  if( PlayerPressedJumpButton() && MarioIsOnTheGround() )
  {
    velocity.y -= jump_speed;  // higher value = higher jump
  }

  // move left/right
  if(PlayerWantsToMoveLeft())
  {
    velocity.x -= move_speed;  // higher value = faster accelleration
      // but not higher top-speed.  Note you can have
      // different values here for when mario is on the ground vs. on ice
      // vs. in the air.  Example the accelleration might be low when in the
      //  air vs. high when on the ground

    if(velocity.x < -topspeed)  // higher value = higher top speed
      velocity.x = -topspeed;
  }
  if(PlayerWantsToMoveRight())
  {
    velocity.x += move_speed;
    if(velocity.x > topspeed)
      velocity.x = topspeed;
  }

  // gravity
  if(!MarioIsOnTheGround())
  {
    velocity.y += gravity;  // higher value = more gravity
  }

  // slow the player down if they are not moving
  if(!PlayerWantsToMoveLeft() && !PlayerWantsToMoveRight())
  {
    if(velocity.x < 0)
    {
      velocity.x += slowdown;  // higher value = quicker slowdown
         // again, air, ice, ground can have different values.  You could
         //  also just use move_speed for this I suppose
      if(velocity.x > 0)  // stop
        velocity.x = 0;
    }
    else
    {
      velocity.x -= slowdown;
      if(velocity.x < 0)
        velocity.x = 0;
    }
  }

  // terminal velocity
  if(velocity.y > terminalvelocity)
    velocity.y = terminalvelocity;  // the highest speed at which you can fall

  // move Mario
  MoveMario( velocity );

  DoCollisionDetectionAndStuff();

  // note you might want the collision detection to alter the velocity.
  //  for example set velocity.y to zero if you hit a floor/ceiling, or
  //  velocity.x to zero if you move into a wall.  Or multiply them by
  //  a negative constant to "bounce off" a rubber wall or something.
}

26
SFML projects / SFSL - SFML File System Library
« on: September 28, 2011, 08:18:55 pm »
That's because there isn't one.  It's still quite a ways away from seeing a release.

I might release a "read-only" version of the zip file thing once I feel it's stable enough.  But writing will take a bit more time.  I don't get to work on it as much as I'd like.

27
SFML projects / SFSL - SFML File System Library
« on: September 28, 2011, 06:38:48 am »
In the words of Altered Beast... "Wiiise fwom your gwaaave!"

Work has been killing me, but lately I've been pushing to get more work on this done.

Made another breakthrough today!

I'll let the screenshot cover it:




PS:  I know I'm leaking memory in that snippit  =P

28
Graphics / Pixel-perfect Sprite SubRect
« on: September 26, 2011, 08:49:04 am »
I would extend the texture so the tile graphics are actually 18x18, but you only draw the inner 16x16.  That way even if it blends it will just draw more of the same image and will look fine.

Another option would be to simply not have fractional positions.  IE:  don't draw to (5.5, 6.5).

29
General / Operator overloading
« on: September 23, 2011, 03:56:13 pm »
Quote from: "Laurent"
You should also make operators non-member functions as much as possible,

Quote from: "Nexus"
I would use global functions for + and - operators.


Can you guys elaborate your rationale for this?  I feel the exact opposite.  Putting operators in their respective class whenever possible keeps the code more organized, IMO.  The only time I put them outside the class is when I have to (if the lhs isn't an object).

I'm interested in hearing other viewpoints.

30
General / Can SFML operate with C++ Exceptions disabled
« on: September 20, 2011, 04:26:43 am »
There's nothing wrong with exceptions when used properly.  Any guide that outright forbids them is not one that I would take to heart.

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