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 - 42yeah

Pages: [1]
Window / Re: Issues with window initializing using sf::ContextSettings
« on: March 05, 2018, 04:46:40 pm »
You forgot to "bind"/use the shader  ;D

prog = ...;

Some hints for the future:

Surround your opengl calls with glGetError() you could have a look at my error handling

basically all my opengl calls look like:
and when an error occurs an exception is thrown.

And have a look at some opengl debug tools. I can highly recommend this one. It has a nice GUI where you can jump between frames and have a look at the context state (active shaders / textures / framebuffers...) at every opengl call  :D

AlexAUT, you're cool!
I can't mess around my mac now since i am in university again :'(. However, i will try that as soon as I can. Thanks!!

通过我的 XT1650-05 上的 Tapatalk发言

Window / Re: Issues with window initializing using sf::ContextSettings
« on: March 03, 2018, 02:17:48 pm »
I just skimmed over your opengl code and it looks fine so here are some guesses:

1) sf::RenderWindow does alter the state of the context after creation, so try to call window.resetGLStates() after the creation of the window.

2) Try to use a sf::Window instead of the sf::RenderWindow, since you use a 3.3 core context the graphics module of SFML won't work anyways. The sf::Window won't touch your contenxt  ;)

3) Shader code correct?


Hey AlexAUT! I tried all your suggestions but none of them works  :'(
Here's my shader & program output:
Vertex Shader rc: 1
Vertex Shader:
Fragment Shader rc: 1
Fragment Shader:
Prrogram rc: 1
The vertex shader rc is glGetShaderiv and vertex shader is glGetShaderInfoLog. So the shaders should be working correctly.

Here's the shader code if you want:

vertex shader:
#version 330 core

layout (location = 0) in vec3 aPos;

void main() {
    gl_Position = vec4(aPos.xyz, 1.0);

fragment shader:
#version 330 core

out vec4 color;

void main() {
    color = vec4(0.1, 0.2, 0.3, 1.0);

Thanks a lot!  :)

Window / Issues with window initializing using sf::ContextSettings
« on: March 03, 2018, 12:51:45 pm »
Hi! I'm quite a newbie to sfml, and here's what I got when I am trying to initialize a sf::RenderWindow with an sf::ContextSettings:

Error. Unable to create the context. Retrying without shared context.
Warning. New context created without shared context.

Also the triangle I want is not displayed on the screen...

So here's the ContextSettings:
sf::ContextSettings settings;
settings.depthBits = 24;
settings.stencilBits = 8;
settings.antialiasingLevel = 4;
settings.majorVersion = 3;
settings.minorVersion = 3;
settings.attributeFlags = sf::ContextSettings::Core;

And here's the complete code, if you are interested:
(click to show/hide)

Thanks a HUGE LOT for your help!!!
I'm using macOS High Sierra.

Pages: [1]