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.


Topics - Meteorhead

Pages: [1]
1
Feature requests / Custom made event handling
« on: May 16, 2012, 05:45:49 pm »
I think many people would welcome the idea of a custom made messages could be passed to threads constructed from sf::Thread. sf::Window can accept messages coming from the OS, react to them, and also put the controlling thread to sleep until a message arrives.

Would it be possible to have an sf::EventHandler class, that is practically this functionality, only without a window (so practically not making a hidden window, only for a message handler), and be able to pass messages between threads, with the possibility of puting one thread to sleep until it recieves a custom message?

By custom messages I mean templated events (or any type of event that allows custom data to be carried along with it) that the user can use as he/she sees fit.

This would be the basis of proper event-based application design.

So far the event system is only usable for OS-window communication.

2
Graphics / Resize window of app with native OpenGL render
« on: May 11, 2012, 11:52:55 am »
Hi,

I have read through the search hits to this problem and found no solution, so I take the liberty of posting a new question after roughly an hour of debug to no avail.

I have an app that uses native rendering beside SFML text render, and I have a problem when I resize my window. Infact the entire screen turns black.

Every frame when I render my things, I issue glUseProgam() to enable using my shaders, and when redering text, I use push/popGLStates to save my state of the statemachine, and to revert it back. I have found that push states does not save the program being used, that's why I lazily issue it every time before render. However, when I handle events at the begininng of the guiLoop(), I have to update my viewMatrix inside the shader. For that I need glUseProgram so the application knows which shader should have it's matrix updated. Here is the code:

// Set view matrix upon window resize
if (event.type == sf::Event::Resized)
{
        m_matProj = glm::perspective( 45.0f, ((float)event.size.width)/event.size.height, 0.01f, 100.0f);
        OpenGL.lock();
        mainWindow->setActive();
        mainWindow->setView(sf::View(sf::FloatRect(0, 0, (float)event.size.width, (float)event.size.height)));
        glViewport(0, 0, event.size.width, event.size.height); auxRuntime->checkErr(glGetError(), cl::ERR, "glViewPort()");
//      glUseProgram(glProgram); auxRuntime->checkErr(glGetError(), cl::ERR, "glUseProgram(glProgram)");
        std::cout << glProgram << "  " << projectionMatrixLocation << "\n";
        glUniformMatrix4fv(projectionMatrixLocation, 1, GL_FALSE, &m_matProj[0][0]);
        auxRuntime->checkErr(glGetError(), cl::ERR, "glUniformMatrix4fv(projectionMatrix)");
        mainWindow->setActive(false);
        OpenGL.unlock();
}

Funny thing is, having glUseProgram uncommented, things only distort, but when I actually try to update the matrix, the screen turns black. It is the very same routine I used to initialize the matrix in the first place.

What am I doing wrong?

3
Feature requests / Windows 8 support
« on: May 04, 2012, 11:41:04 am »
Hi!

I know this is yet another request that is less pressing than some current issues, however:

- Could the CMake scripts be made Win8-ready? I have tried to build SFML under Win8 Consumer Preview with VS2011 (first with NMake), but the scripts fail to find many files. It was strage, that gl.h doesn't ship with the dev SDK of Win8, neither does it come with VS2011.

- Creating a new WinRT variant of the classes I believe would take a HUGE effort, but if people would find it useful, put a "+1" here.

4
General discussions / Avast alarm
« on: April 20, 2012, 07:34:05 pm »
Hi,

I know I must've been very famous with my switching from dynamic cmake scripts to the static ones, but here's the next issue:

for some unknown reason, Avast seems to argue about my application, that it is suspected to be a malware. I thought that it might think because I'm launching new threads (but hey, that is no black magic), but now I'm seeing that all (!) SFML and SFGUI examples also cause an alarm. You know all the details of the lib, I have no chance at guessing what could cause the trouble. I'm building both libs statically, and Avast just got updated today (or yesterday, can't remember).

Would you like me to do any tests?

Cheers,
Máté

p.s.: could it be the doing of importing symbols of GLEW at static build?

5
Graphics / OpenGL states misbehaving
« on: March 11, 2012, 11:16:14 am »
Hi Laurent,

I have posted a while back about SFML lacking GUI support. I have found a very promising project (SFGUI) which integrates neatly into SFML code and is able to create viable GUI. It will not have a native look to it, but that's a cost I'm willing to pay if code stays neat, no extra compilers or SDKs are needed and the likes.

I have started learning SFML and building a codebase for myself, but it seems that the OpenGL part is misbehaving.

GLPushMatrix() and GLPopMatrix() do not function the way they claim to. I use OpenGL 3.2+ syntax, namely I handle all matrixes myself and use VertexArrays and attrib params to them. After I render my scene, a single shaded triangle. I call glFinish() after my part of the rendering to make sure it doesn't mix with internal SFML stuff. I PushStates, render the text and PoPStates. After this, my triangle loses shading and is mispositioned.

While writing the post, it popped into my mind, that maybe the program usage is not restored, and my guess was right. If I reissue glUseProgram(myProgram) after text render, both display correctly. Is this a bug, os simply program is not restored by the Push/Pop?

Cheers,
Máté

Pages: [1]
anything