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

Pages: [1]
1
Graphics / Re: GLSL 430 gl_TexCoord
« on: April 20, 2016, 06:17:19 pm »
It's not true?
Then where are defined default shaders?

EDIT:
src\SFML\Graphics\Shader.cpp, line 857, function Shader::bind()

if (shader && shader->m_shaderProgram)
{
    (...)
}
else
{
    // Bind no shader
    glCheck(GLEXT_glUseProgramObject(0));
}

If you don't bind your custom shader SFML sets fixed pipeline rendering.

2
Graphics / Re: GLSL 430 gl_TexCoord
« on: April 20, 2016, 05:51:12 pm »
Ok is see. Thanks a lot.
I will implement VS to pass texture coords.

3
Graphics / Re: GLSL 430 gl_TexCoord
« on: April 20, 2016, 04:11:08 pm »
Ok so I need to send texcoords to fragment, from vertex shader. Its required to know them in vertex.
Does each vertex of SFML sprite mesh has assigned texcoords?

Something like that.

Btw. If I dont assign my own shader what is going on with gpu flow? Does SFML sets its own shaders? If true then those shaders also should provide texture coordinates to properly map texture on the triangles. Right?

4
Graphics / GLSL 430 gl_TexCoord
« on: April 19, 2016, 04:59:25 pm »
It's not strictly SFML problem but maybe someone could help me.
How can I access texture coordinates in fragment shader (version 430)?
gl_TexCoord is depracted since 120.

gl_FragCoord gives info about pixel coordinates in render target metrics. I want coordinates in rendered square metrics (0-1, 0-1).

Does I need to provide my own vertex shader to pass texture coordinate? Is there any easy way to perform it with standard SFML sprite?

I have read about gl_SamplePosition, but it doesn't work - it is always set to (0.5, 0.5).
Probably multisample rasterization is disabled - can I enable it for sfml renderTexture?


5
General / Re: Key event ALT + CONTROL
« on: April 01, 2016, 03:33:23 pm »
Ok, I see.
I will ignore control if alt is pressed.

Thanks for all replies.

6
General / Re: Key event ALT + CONTROL
« on: April 01, 2016, 02:56:47 pm »
So tell me how I should check for key combination: Alt + Ctrl + X for example. SFML gives me information that control is pressed but I have check again if control is really pressed. If it uses GetAsyncKeyState then I will get wrong results..

This is how it's done in SFML
Event event;
event.type        = Event::KeyPressed;
event.key.alt     = HIWORD(GetAsyncKeyState(VK_MENU))    != 0;
event.key.control = HIWORD(GetAsyncKeyState(VK_CONTROL)) != 0;
event.key.shift   = HIWORD(GetAsyncKeyState(VK_SHIFT))   != 0;
event.key.system  = HIWORD(GetAsyncKeyState(VK_LWIN)) || HIWORD(GetAsyncKeyState(VK_RWIN));
event.key.code    = virtualKeyCodeToSF(wParam, lParam);
pushEvent(event);
So WinAPI returns this info about control and alt. But I'm little confused - how to check key combination "Right Alt + Ctrl" in real?

7
General / Re: Key event ALT + CONTROL
« on: April 01, 2016, 02:36:12 pm »
I have the same layout.

SFML doc
http://www.sfml-dev.org/documentation/2.0/structsf_1_1Event_1_1KeyEvent.php
bool alt : Is the Alt key pressed?
bool control : Is the Control key pressed?

I dont know cases when right alt ("right menu" in WinAPI) is in union with control, but IMO
these flags in event object should represent state of individual keys. Otherwise there sould be some abstraction layer over keyboard layout.

Maybe this sould be reported as an issue?

One more thing. You are probably more familiar in SFML than me. Could you help to find code fragment that I should change in SFML to avoid this behavior?

8
General / Re: Key event ALT + CONTROL
« on: April 01, 2016, 01:42:01 pm »
Right, This example is only for testing (not real implementation).

But what with this bug?
http://prntscr.com/amqwoe

EDIT: I took screen after compiling your code.
Could you send me binary? I would check it on my machine.

Also note that it occurs only with right alt. Left alt works fine.

9
General / Key event ALT + CONTROL
« on: April 01, 2016, 01:07:14 pm »
Hi all,

I'm using SFML 2.3.2 x32 and I have problem with key events.
When I press Alt + s to input "ś" (in Polish keyboard) I gets event with key = { code: 18, alt: true, control: true }
Control is wrongly set to true.
Is there any fix for that?

EDIT: Note that it's right alt. Left alt works fine.

BTW. I know about event TextEntered, but I pass events into external library (GWEN) and it checks control variable in order to perform special actions.

Code sample to debug error:
bool handleEvent(const sf::Event& event)
{
        if(event.type == 5)
                std::cout << event.key.code << " a: " << (int) event.key.alt << " c: " << (int) event.key.control << " s: " << (int) event.key.shift << "\n";

        return EventHandler::handleEvent(event);
}

Pages: [1]
anything