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

Pages: 1 ... 9 10 [11] 12 13 ... 34
151
SFML website / Re: Link to different versions
« on: August 16, 2016, 07:50:02 pm »
2.3.2 - 2.4.0: Requirement of using setUniform instead of setParameter forcing all setParameters to be replaced to be able to use 2.4.

setParameter can still be used though, since it was deprecated, not removed.

152
General discussions / Re: SFML 2.4.0 released
« on: August 16, 2016, 07:41:36 pm »
Mind if I bump my CSFML pull? No one from the team has commented on it yet - and I'm curious if it's being looked over or simply if no one has gotten around to it yet. :)

(Not intending to rush, just falling victim to my curiosity!)

153
SFML projects / Re: Super Mario game
« on: August 16, 2016, 07:33:04 pm »
SFML.NET and CSFML aren't updated to 2.4 yet (But I'm working on it), so you can't use it. You've gotta use 2.2, just download the whole zip from the sfml's website, extract it, and it essentially just works.
Pick 32-bit and/or 64-bit, and make sure you add references to (and copy) the correct dlls based on your target architecture in Visual Studio.
I personally disable the "Any CPU" target, and set only x86 and x64, though that may partly be because I find it easier to be explicit in what I want (and/or I'm just more familiar with C++ compilers). :)

That error message just means that .NET can't find the dll it specifies, or one of that dll's dependencies. Make sure you have all the dll's from the SFML.NET download copied to the same directory as the produced exe.

154
Graphics / Re: Upgraded from 1.6 to 2.4.0 is ~18 Times Slower
« on: August 16, 2016, 07:27:35 pm »
Well, at lines 149-152:
image.create(WindowX, WindowY, sf::Color(0, 50, 25));
texture.create(WindowX, WindowY);
texture.update(image);

You're creating an image in RAM and uploading it to VRAM every single frame. Of course that's going to be slow. I'm assuming this is demo code since the image isn't changing at all, but, I wouldn't be surprised if this is at least part of your slow-down.

However, the best thing to do, since you're using Visual Studio, would be to use its built-in profiler to figure out which function calls are taking up the most time.

155
SFML projects / Re: Super Mario game
« on: August 16, 2016, 09:24:30 am »
You're trying to load a file that doesn't exist in data load.cs:53. (copy and paste error?) Changing the path to "dir + Hammer.wav" fixed the crash for me.

Though it seems like it might be stuck in an infinite loop when loading the first stage. Or I'm impatient. :) (Might want to consider allowing the user to "press any key to skip" during intros/etc)

Also, personally, the color flashing in the second intro is a bit much. :)

156
General discussions / Re: SFML 2.4.0 released
« on: August 10, 2016, 08:29:41 pm »
Is SFML.Net 2.2 getting an update?
At some point, certainly. Feel free to help update CSFML and SFML.NET.

So people are aware to help avoid work duplication, I've started doing this.
https://github.com/dabbertorres/CSFML/tree/2.4
https://github.com/dabbertorres/sfml.net/tree/2.4

157
SFML website / Re: Add a bookmark icon
« on: July 09, 2016, 11:38:14 am »
If more work needs doing, I recently found out about a favicon generator site (supporting everything under the sun) that might help.

158
Graphics / Re: Rendering problem with RenderTexture.getTexture()
« on: June 19, 2016, 01:40:31 am »
Your code given doesn't describe what your problem exactly, because this works for me:
#include <SFML/Graphics.hpp>

int main()
{
        sf::RenderWindow win{{800, 600}, "Render Textures"};

        sf::RenderTexture rt1;
        rt1.create(200, 200);

        sf::RenderTexture rt2;
        rt2.create(500, 500);

        while(win.isOpen())
        {
                sf::Event ev;
                while(win.pollEvent(ev))
                {
                        switch(ev.type)
                        {
                                case sf::Event::Closed:
                                        win.close();
                                        break;

                                default:
                                        break;
                        }
                }

                rt2.clear(sf::Color::Green);

                for(int i = 0; i < 4; ++i)
                {
                        auto r = rt1.getSize().x / 4.f;
                        sf::CircleShape cir{r};
                        cir.setFillColor(sf::Color::Red);
                        cir.setOrigin(r, r);
                        cir.setPosition(rt1.getSize().x / 2.f, rt1.getSize().y / 2.f);

                        rt1.clear(sf::Color::Blue);
                        rt1.draw(cir);
                        rt1.display();

                        auto s = rt2.getSize().x / 2;
                        auto b = s / 10;

                        sf::Sprite rs1{rt1.getTexture()};
                        rs1.setPosition((i % 2) * s + b, (i / 2) * s + b);

                        rt2.draw(rs1);
                }

                rt2.display();

                sf::Sprite rs2{rt2.getTexture()};
                rs2.setOrigin(rt2.getSize().x / 2.f, rt2.getSize().y / 2.f);
                rs2.setPosition(win.getSize().x / 2.f, win.getSize().y / 2.f);

                win.clear();
                win.draw(rs2);
                win.display();
        }

        return 0;
}

(click to show/hide)

159
Graphics / Re: Rendering problem with RenderTexture.getTexture()
« on: June 18, 2016, 06:40:38 am »
You need to use sf::RenderTexture::clear() and sf::RenderTexture::display(), just like with a window.

160
Graphics / Re: SFML and Game time
« on: June 03, 2016, 12:07:15 am »
I think I may at least partially understand your issue.

You're trying to smush 2 dimensions (x and y) into 1 dimension for rk4. ("State" in gaffer's article.)
Remember that dimensions are completely separate from one another!

Gaffer's article shows rk4 in only 1 dimension. Be careful with x and y in some articles. x and y may be used as variable names without much meaning, whereas they represent different spatial dimensions in physics. :)

Are you familiar with Taylor Series? The RK4 is similar-ish.

Constant position (1st order): p(t) = c.
Constant velocity (2nd order): p(t) = v * t + c.
Constant acceleration (3rd order): p(t) = a * t^2 + v * t + c.
Constant jerk (4th order): p(t) = j * t^3 + a * t^2 + v * t + c.
(Yes, "jerk" is the correct name for "change in acceleration". However, I guess it's sometimes called a "jolt". Yes, it exists. Real-life example: you pressing the gas pedal in a vehicle is jerk, as you are changing the acceleration of the vehicle.)

You can keep going, but, there's a point where it's just inane (jerk is usually that point).

Euler's method is inaccurate when any of the above values are not constant over a timestep, 't' (realistically true). Gaffer explains this in the beginning of his article you linked.
And since computers are finite, we can't be as accurate as the real world, hence the concept of a timestep.

RK4 takes this into account, and takes 4 samples ahead, where each following sample uses the previous sample to calculate itself, to more accurately estimate changes in velocity, acceleration, and jerk.

I hope this helps RK4 make more sense.

As for your acceleration function you have there, that's not acceleration due to gravity. That's acceleration due to a spring, Hooke's Law.

What you should do in that function, is add together all sources of acceleration on an object. Gravity, collisions, friction, drag.... springs. :) Then return that total.

Also, since you're using VB.NET, C# DLLs should *just work*, since they both are just compiled to CLR IR.

161
Easy method: mutable

162
Graphics / Re: SFML and Game time
« on: May 27, 2016, 08:04:28 am »
The option I'm partial towards is letting the player choose. Have a V-sync option, and a frame rate limit option. I've seen several AAA games do this. So, by default, for example, you simply have neither enabled (or whatever you think is best). Then players can choose as they like.

Just make sure to make them mutually-exclusive!

163
Graphics / Re: SFML and Game time
« on: May 26, 2016, 08:30:37 pm »
Well for one, you don't want both a framerate limit and Vsync.

Two, having a fixed timestep allows for your game to run flexibly, while more-or-less playing the same on different quality hardware. Lower FPS on low-end machines, and higher FPS on high-end machines. But, due to the fixed timestep, the game will still run as desired (potentially except for machines below your minimum required specs).

164
DotNet / Re: OpenTK and SFML
« on: May 20, 2016, 08:13:16 pm »
I can reproduce it on my home machine (driver 365.10).

Investigating, it looks like I may be correct, seems it may be a race condition:
(click to show/hide)

NVIDIA's driver may potentially be doing some extra threading that interferes with both SFML and OpenTK using the context, that Intel's driver does not do.

Unfortunately, this is getting out of the realm of my knowledge, so I'm not really sure where to go from here.

165
DotNet / Re: OpenTK and SFML
« on: May 19, 2016, 10:31:46 pm »
What about the last code I pasted above? (It doesn't call either of those functions.)

Hmm. I ran it on my work computer, which is just an intel graphics card.

I have a GTX 970 as well at home (can't remember driver version, prolly the latest), I'll see if I can repro it.

Pages: 1 ... 9 10 [11] 12 13 ... 34