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

Pages: [1] 2 3
1
General discussions / New Shader class in SFML 2 to replace PostFx
« on: February 11, 2010, 03:07:23 am »
Whenever I try to use sf::Shader::CurrentTexture it does not link telling me "unresolved external symbol "public: static class sf::Image const sf::Shader::CurrentTexture"". This also happens in the Shader example. I have linked sfml-graphics.lib and other graphics do work fine. I am using SFML2 revision 1399.
Thanks.

2
Window / SFML 2: "Failed to activate the window's context"
« on: February 10, 2010, 03:52:31 am »
Yes I am, I should be creating a context in the second thread and then doing SetActive(false). I have updated my first post with a working example for anyone else that has this problem.

3
Window / SFML 2: "Failed to activate the window's context"
« on: February 10, 2010, 01:12:12 am »
Im running SFML 2 revision 1395 on windows 7 x64 using msvc 2008. When the code below is run it outputs "Failed to activate the window's context". Am I doing something wrong?
Thanks.
Code: [Select]

#include <SFML/System.hpp>
#include <SFML/Window.hpp>

sf::Window *window;
bool good;

void ThreadFunc(void* data)
{
   sf::Context context; //Added this line
window->Create(sf::VideoMode(640,480), "test");
   window->SetActive(false); //Added this line
good = true;
while (1)
sf::Sleep(1);
}

int main()
{

good = false;
window = new sf::Window();
sf::Thread mythread(&ThreadFunc, NULL);
mythread.Launch();
while (!good)
sf::Sleep(0.001f);
sf::Context context;
window->SetActive(true);
mythread.Terminate();
delete window;
return 0;
}

Edit: updated the code with working code.

4
Window / Show FPS In Title Bar Window
« on: August 24, 2009, 11:28:42 pm »
Quote from: "Sirt"
It sounds like a neat idea though having an fps counter in the titlebar.

You could create an sf::RenderWindow without a titlebar,
then blit your image of a titlebar to the top of the screen every frame while also outputing an sf::String anywhere in that titlebar.

(just a thought).


That would only work for one platform. Imagine running a program on linux and having the windows xp titlebar showing up.

5
Window / Show FPS In Title Bar Window
« on: August 05, 2009, 06:15:05 am »
There currently is no way to change the window title.

6
General / CEGUI SFML Render Module.
« on: August 04, 2009, 06:01:01 am »
I have been trying to make a CEGUI render module, but it is not going well.
I know somewhat what I am doing wrong, but I have no idea how to fix it.
It runs very slow and the buttons do not show up correctly. Should I stick with using the OpenGL render module?

One thing that I don't know how to do with sfml is set differnt corners different colours.

bad using my sfml renderer


good using opengl renderer


Source

Any tips would be very helpful.

Thanks.

7
Graphics / Can't load sf::Sprite from a function
« on: August 03, 2009, 11:07:52 pm »
The right was would be passing some form of smart pointer. It would fix the problem and memory management would not be an issue.

But, a manager should be looked into for any serious project.

8
General discussions / Google Summer of Code
« on: August 03, 2009, 11:04:58 pm »
I don't think you can sign up for 2010 yet because the 2009 summer of code is still going on.

This year sign up was in march. I will update you with more information as it comes.

9
General discussions / Google Summer of Code
« on: August 03, 2009, 04:26:41 am »
Have you ever thought about entering SFML into Google Summer of Code. A mentor is needed and Laurent is probably the only one who qualifies at the moment, so only one project could be done per year. I think it would really help SFML be known and also get new features implemented.

I am personnaly looking for a project to work on in next years summer of code, and if SFML is in I would love to work on it.

You have lots of time to think about this as it's a year away.

10
As long as the api stays the same, a hidden render thread could be added and beginner users would not notice. I am not sure if this is possible though. When I get a chance I will try to implement this.

11
Graphics / Linker warning (SFML-2.0)
« on: July 31, 2009, 09:30:14 pm »
Hmm I thought verbose would provide some usefull information. Everything looks correct to me.

Hopufully someone knows how to fix this.

Edit after seeing the above post: Were there any warnings when compileing sfml? It would probably have the same warning if freetype.lib was the cause.

12
Graphics / Linker warning (SFML-2.0)
« on: July 31, 2009, 09:15:28 pm »
Try using /VERBOSE:LIB in the extra command line options for the linker. It should tell you a bit more about the problem.

From MSDN
Quote
The run-time libraries now contain directives to prevent mixing different types. You will receive this warning if you try to use different types or debug and non-debug versions of the run-time library in the same program. For example, if you compiled one file to use one kind of run-time library and another file to use another kind (for example, single-threaded versus multithreaded) and tried to link them, you will get this warning. You should compile all source files to use the same run-time library. See the  Use Run-Time Library (/MD, /MT, /LD) compiler options for more information.

Source

Im not sure if that quote applies because you are using sfml-graphics-s.lib and it says libcmt witch is the static version. Are you compiling them both in release or both in debug?

13
One thing that I do in my project is in my update thread
Code: [Select]

if (lastWidth != App.GetWidth() || lastHeight != App.GetHeight()){
    lastWidth = App.GetWidth();
    lastHeight = App.GetHeight();

    float currentRatio = (float)lastWidth/(float)lastHeight;
    float correctY = 320/currentRatio;
    view.SetFromRect((sf::FloatRect(0, 0, 320, correctY)));
}

Using this I am able to get real time resizing. Something similar (and better written) would go well in your project.
I dont use the resize event in the event loop because it blocks untill the resizing is done.  

@Laurent would it be possible to use some code similar to this in sfml for better resize event prossesing?

14
Graphics / Two small graphics problems.
« on: July 29, 2009, 06:03:54 pm »
I fixed it using Image->CreateMaskFromColor(sf::Color(255,255,255)); to make the padding all transparent.
But I am still wondering about vsync.

15
Graphics / Two small graphics problems.
« on: July 29, 2009, 05:49:58 pm »
Only problem is the top bar and bottom bars. Some/most sprites are right on the bottom so i cannot cut off a pixel. I know that this has something to do with Anti Aliasing/ smoothing.

Pages: [1] 2 3
anything