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

Pages: [1]
1
General / A * help!
« on: October 03, 2010, 10:39:56 am »
Are you sure you've completely understood the algorithm? If so, it should actually be no big deal to implement it in C++. Maybe you should first start out with Dijkstra's algorithm, since A* is just an extension of it.
The hard part about it is rather how to integrate the algorithm and the associated data structures properly into your game's environment.

2
Graphics / Black Screen for a short moment
« on: October 03, 2010, 10:33:43 am »
No, I was talking about a minimal example in code, so that your problem can be understood without having to compile and look through tons of source files. I, for example, can't even compile the source code you uploaded, since you were using a different version of SFML, thus the interface has become incompatible.

3
Graphics / Black Screen for a short moment
« on: October 01, 2010, 04:37:06 pm »
It might be very helpful to be provided with a minimal example reproducing the problem.

4
General / MSVC++ 2010 64 bit libraries
« on: September 29, 2010, 09:11:19 pm »
Oh of course, I forgot to mention that in the rush...So here's a short manual.

First of all, I built the latest versions of the extension libraries for 64 bit. The easiest way to do this is to download the source packages from the developers' sites and use CMake for Makefile (resp. .vsxproj) generation.

libjpeg however is a bit off at that, since it has no CMakeFileList.txt. Instead you have to - watch out, it's really sophistical... - rename the file makevcxproj.v10 and adjust the file extension, as it is simply a disguised Visual Studio 2010 project. Additionally, the file jconfig.h should be overwritten with the content of jconfig.vc, at least it's recommended by the installation guide.

All of the other libraries should build just fine when you have a very basic knowledge on how to work with CMake (the GUI makes it kind of snap, actually).

You should then replace the files in your SFML2.0/extlibs folder with those you just created (and of course rename them accordingly) and then have your VS2010 solution generated by CMake once again for the SFML2.0 build. You need to do this two times: One time with "Build shared" enabled, and one time without, so that all of the needed binaries are created.
Then just load up the respective solution and build the "BUILD-ALL" project. If everything was adjusted correctly, you should, after a few seconds - or minutes, depending on your processor - be the proud owner of a freshly baked SFML2.0 64 bit build.

I hope this short instruction was helpful :)

regards,
Debilo

5
Graphics / Crash on glDeleteFramebuffersEXT
« on: September 29, 2010, 04:29:17 pm »
Hey guys,
I know, this is my 3rd thread within a week or so, but as soon as I registered here, problems that I'm not able to solve myself magically started coming up...

Given the following code:
Code: [Select]
#include <SFML/Graphics>

int main()
{
if (!sf::RenderImage::IsAvailable()) return -1;
sf::RenderImage img;
        if (!img.Create(800, 600)) return -1;
} // Crash


As the comment already implies, my program crashes when calling sf::RenderImage::~RenderImage(). Mory exactly, the unhandled exception appears to come from the following piece of code in RenderImageImplFBO.cpp:
Code: [Select]
RenderImageImplFBO::~RenderImageImplFBO()
{
    // Destroy the depth buffer
    if (myDepthBuffer)
    {
        GLuint depthBuffer = static_cast<GLuint>(myDepthBuffer);
        GLCheck(glDeleteFramebuffersEXT(1, &depthBuffer));
    }

    // Destroy the frame buffer
    if (myFrameBuffer)
    {
        GLuint frameBuffer = static_cast<GLuint>(myFrameBuffer);
        GLCheck(glDeleteFramebuffersEXT(1, &frameBuffer)); // Crash
    }
}


Yet again, the comment indicates where the crash occurs.
Operating system is Windows 7 64 bit, SFML version is the latest SVN snapshot of 2.0, custom built binaries for 64 bit (the crash occurred under 32 bit, too, anyway). My graphics "card", if this is somehow relevant, is an Intel HD Graphics onboard chip.

I don't know if I made a mistake using sf::RenderImage or if I discovered an SFML bug. Maybe you can help me out

regards,
Debilo

6
General / MSVC++ 2010 64 bit libraries
« on: September 29, 2010, 04:17:30 pm »
It seems I finally got it working.
Thus, here are the libraries, for anyone interested:
http://www.file-upload.net/download-2853289/SFML2.0-Win64-Binaries.zip.html

7
General / MSVC++ 2010 64 bit libraries
« on: September 26, 2010, 02:27:38 pm »
Hey everybody,
I'm trying to build the latest SFML2.0 snapshot from source, using MSVC++ 2010 Express. All packages were flawlessly compiled, except for the graphics package. Well, it works out great when building static libraries, but as soon as I try to build a DLL, my linker complains about 15 unresolved externals in the Freetype library.
I've built all the extlibs for x64 by hand, including Freetype. But even when I use the extlibs shipping with the snapshot my linker still isn't content with it.

If anyone is wondering why I would do all this: The reason is a crash occuring when sf::RenderImage::~RenderImage() is called after invoking sf::RenderImage::Create().
I was able to trace it back to ig4icd32.dll, which is my graphics driver, so I assume that there might be some trouble with the 32 bit binaries, especially when OpenGL is concerned.
Maybe this is the wrong approach for fixing the problem. If so, I'd of course appreciate any help fixing this problem and thus making a x64-build unnecessary.

However, my competitive spirit was aroused by these nasty linker errors, and I guess it's not exactly a bad idea having native 64 bit binaries instead of the 32 bit ones (although this should not pose a problem, usually).

It'd be great if you can help me out once again,
regards,
Debilo


Edit: Update: I don't know how, but somehow the sfml2-graphics.dll was finally built with no problem. Unfortunately, I don't remember having made a change in the configuration, so it's still nebulous what caused this problem. Building sfml2-graphics-d.dll still produces the errors, though.

Edit2: Well, well, well...just made a 3rd complete new attempt, and it worked. Yet again I have no idea what I might have done to finally convince my linker to swallow it...
And since I'm just in the act of asking:
I wonder how to build sfml2-module.lib. I have *-s.lib, *-s-d.lib, *.dll and *-d.dll, but no *.lib, if you know what I mean. I built SFML for targets "Release Static", "Debug Static", "Release DLL" and "Debug DLL", which
are 4 in number (and I have 4 output binaries). Where is the rest? (I guess I'm just not seeing it at the moment)

Edit3: Yay, everything works fine, 64bit libs built successfully...

8
Graphics / Weird results with blur shader
« on: September 24, 2010, 02:38:49 pm »
Yep, just a simple image filter. Thanks for your suggestion, seems useful.

9
Graphics / Weird results with blur shader
« on: September 22, 2010, 07:56:15 pm »
Oh boy, that's what I call awkward! Actually, I'm sitting here laughing, though. Texture coordinates are a great thing, indeed.
Thanks alot, however, I guess that fits into "First think, then write your code"...gosh!

10
Graphics / Weird results with blur shader
« on: September 22, 2010, 06:28:15 pm »
Hey guys,
I'm currently trying to get into shader programming a bit. However, I encounter a problem which doesn't appear to make any sense to me.
The shader I'm using is the following:
Code: [Select]
uniform sampler2D tex;

void main()
{
    vec4 sum = vec4(0.0);
    vec2 offx = vec2(1.0, 0.0);
    vec2 offy = vec2(0.0, 1.0);
    sum += texture2D(tex, gl_TexCoord[0].xy - offx - offy);
    sum += texture2D(tex, gl_TexCoord[0].xy - offy);
    sum += texture2D(tex, gl_TexCoord[0].xy + offx - offy);
    sum += texture2D(tex, gl_TexCoord[0].xy - offx);
    sum += texture2D(tex, gl_TexCoord[0].xy);
    sum += texture2D(tex, gl_TexCoord[0].xy + offx);
    sum += texture2D(tex, gl_TexCoord[0].xy + offx + offy);
    sum += texture2D(tex, gl_TexCoord[0].xy + offy);
    sum += texture2D(tex, gl_TexCoord[0].xy - offx + offy);
    gl_FragColor = (sum / 9.0);
}
It's a plain, simple box filter. I can't spot any mistakes in it, which might be owed to the fact that I'm lacking any experience with shader programming.

A minimal example for the C++-code is:
Code: [Select]
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow win(sf::VideoMode(800, 600), "Shader");
    sf::Image image;
    image.LoadFromFile("tulips.jpg");
    sf::Shader postEffect;
    postEffect.LoadFromFile("blur.sfx");
    sf::RenderImage renderImage;
    renderImage.Create(win.GetWidth(), win.GetHeight());
    renderImage.Clear();
    renderImage.Draw(sf::Sprite(image));
    renderImage.Display();

    sf::Sprite screen(renderImage.GetImage());

    while (win.IsOpened()) {
        sf::Event e;
        if (win.GetEvent(e)) {
            if (e.Type == sf::Event::KeyPressed && e.Key.Code == sf::Key::Escape) {
                win.Close();
            }
        }
        win.Clear();
        win.Draw(screen, postEffect);
        win.Display();
    }
}

Yet again, I can't see a problem with it. I tried to stick as close to the examples given here (http://www.sfml-dev.org/forum/viewtopic.php?p=11699) as I could. Nevertheless other approaches elicit just the same problem, namely:




I'm using the SFML2.0 binaries for Visual Studio 2010, someone uploaded them here in the forum a while ago. Operating system is Windows 7.
While writing this, it occurs to me that the graphics chip of my notebook is merely an Intel HD Graphics onboard-chip, but that should not pose a problem, I expect.

I hope some of you are able to spot the certainly quite obvious error. I can't, however, so thanks in advance.

Regards,
Debilo

Pages: [1]