D'accord, pas de problème ! Merci de m'aider ! :)
Alors voilà, dans mon code, j'ai seulement et uniquement remplacé :
sf::Window *m_window;
par sf::RenderWindow *m_window;
Et
m_window = new sf::Window(sf::VideoMode(m_xWin, m_yWin), m_titleWin.c_str(), sf::Style::Default, m_setSettings);
par m_window = new sf::RenderWindow(sf::VideoMode(m_xWin, m_yWin), m_titleWin.c_str(), sf::Style::Default, m_setSettings);
Lorsque j'essaye de compiler, voilà ce que j'ai :
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xd78): multiple definition of `__glewWindowPos2dARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3155: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xd7c): multiple definition of `__glewWindowPos2dvARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3155: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xd80): multiple definition of `__glewWindowPos2fARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3155: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xd84): multiple definition of `__glewWindowPos2fvARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3155: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xd88): multiple definition of `__glewWindowPos2iARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3155: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xd8c): multiple definition of `__glewWindowPos2ivARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3155: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xd90): multiple definition of `__glewWindowPos2sARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3155: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xd94): multiple definition of `__glewWindowPos2svARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3155: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xd98): multiple definition of `__glewWindowPos3dARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3156: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xd9c): multiple definition of `__glewWindowPos3dvARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3156: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xda0): multiple definition of `__glewWindowPos3fARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3156: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xda4): multiple definition of `__glewWindowPos3fvARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3156: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xda8): multiple definition of `__glewWindowPos3iARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3156: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xdac): multiple definition of `__glewWindowPos3ivARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3156: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xdb0): multiple definition of `__glewWindowPos3sARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3156: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xdb4): multiple definition of `__glewWindowPos3svARB'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3156: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xdd8): multiple definition of `__glewAlphaFragmentOp1ATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3157: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xddc): multiple definition of `__glewAlphaFragmentOp2ATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3157: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xde0): multiple definition of `__glewAlphaFragmentOp3ATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3157: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xde4): multiple definition of `__glewBeginFragmentShaderATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3157: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xde8): multiple definition of `__glewBindFragmentShaderATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3157: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xdec): multiple definition of `__glewColorFragmentOp1ATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3157: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xdf0): multiple definition of `__glewColorFragmentOp2ATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3157: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xdf4): multiple definition of `__glewColorFragmentOp3ATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3157: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xdf8): multiple definition of `__glewDeleteFragmentShaderATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3157: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xdfc): multiple definition of `__glewEndFragmentShaderATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3158: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe00): multiple definition of `__glewGenFragmentShadersATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3158: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe04): multiple definition of `__glewPassTexCoordATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3158: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe08): multiple definition of `__glewSampleMapATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3158: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe0c): multiple definition of `__glewSetFragmentShaderConstantATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3158: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe28): multiple definition of `__glewArrayObjectATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3158: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe2c): multiple definition of `__glewFreeObjectBufferATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3159: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe30): multiple definition of `__glewGetArrayObjectfvATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3159: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe34): multiple definition of `__glewGetArrayObjectivATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3159: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe38): multiple definition of `__glewGetObjectBufferfvATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3159: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe3c): multiple definition of `__glewGetObjectBufferivATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3159: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe40): multiple definition of `__glewGetVariantArrayObjectfvATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3159: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe44): multiple definition of `__glewGetVariantArrayObjectivATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3159: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe48): multiple definition of `__glewIsObjectBufferATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3159: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe4c): multiple definition of `__glewNewObjectBufferATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3159: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe50): multiple definition of `__glewUpdateObjectBufferATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3159: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe54): multiple definition of `__glewVariantArrayObjectATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3159: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe64): multiple definition of `__glewClientActiveVertexStreamATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3160: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe68): multiple definition of `__glewNormalStream3bATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3160: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe6c): multiple definition of `__glewNormalStream3bvATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3160: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe70): multiple definition of `__glewNormalStream3dATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3160: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe74): multiple definition of `__glewNormalStream3dvATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3160: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe78): multiple definition of `__glewNormalStream3fATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3160: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe7c): multiple definition of `__glewNormalStream3fvATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3160: first defined here
C:\Program Files (x86)\CodeBlocks\SFML-2.0-rc\lib/libsfml-graphics-s-d.a(glew.c.o):glew.c:(.bss+0xe80): multiple definition of `__glewNormalStream3iATI'
obj\Debug\glew.o:D:/Programmation/Robot/glew.c:3160: first defined here
(Je suis désolé du long texte que ça fait :-\ )
Sachant que j'inclue bien <GL/glew.h> avant les includes SFML :)
Merci !
Bon, j'ai réussis à faire quelque chose qui fonctionne ! Merci !
Par contre, j'ai encore un problème...
Mon but à la base était de pouvoir écrire du texte.
Maintenant que GLEW/SFML cohabitent correctement, j'ai fait ceci :
// Declare and load a font
sf::Font font;
font.loadFromFile("arial.ttf");
// Create a text
sf::Text text("hello");
text.setFont(font);
text.setCharacterSize(30);
text.setStyle(sf::Text::Bold);
text.setColor(sf::Color::Red);
Mais quand je lance mon programme, pas de texte du tout, et un message dans la console :
An internal OpenGL call failed in Texture.cpp (95) : unknown error, no description
Qu'est-ce que je peux faire ? :-\
Alors, j'ai essayé de faire un condensé de mes fonctions :
m_window = new sf::RenderWindow(sf::VideoMode(m_xWin, m_yWin), m_titleWin.c_str(), sf::Style::Default, m_setSettings);
GLenum glew_status = glewInit();
if (glew_status != GLEW_OK)
{
std::cout << "[ERROR] Cannot init GLEW : " << glewGetErrorString(glew_status) << std::endl;
return false;
}
if (!GLEW_VERSION_2_0)
{
std::cout << "[ERROR] Your graphic card does not support OpenGL 2.0." << std::endl;
return false;
}
// Enable alpha
glEnable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
//glDepthFunc(GL_LESS);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
bool running = true;
// Declare and load a font
sf::Font font;
font.loadFromFile("arial.ttf");
// Create a text
sf::Text text("Hello");
text.setFont(font);
text.setCharacterSize(10);
text.setStyle(sf::Text::Bold);
text.setColor(sf::Color::Red);
text.setPosition(100,100);
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
Cube cubeTest;
Plan planTest;
glm::mat4 modelview = glm::lookAt(glm::vec3(3.0, 2.0, 5.0), glm::vec3(0.0, 0.0, 0.0), glm::vec3(0.0, 1.0, 0.0));
glm::mat4 projection = glm::perspective(60.0f, 1.0f * m_xWin/m_yWin, 0.0001f, 1000.0f);
while (running)
{
// gestion des évènements
sf::Event event;
while (m_window->pollEvent(event))
{
if (event.type == sf::Event::Closed)
{
// on stoppe le programme
running = false;
}
else if (event.type == sf::Event::Resized)
{
// on ajuste le viewport lorsque la fenêtre est redimensionnée
glViewport(0, 0, event.size.width, event.size.height);
m_xWin = event.size.width;
m_yWin = event.size.height;
}
}
// effacement les tampons de couleur/profondeur
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
m_window->pushGLStates();
m_window->draw(shape);
m_window->draw(text);
m_window->popGLStates();
// dessin...
cubeTest.draw(modelview, projection);
planTest.draw(modelview, projection);
// termine la trame courante (en interne, échange les deux tampons de rendu)
m_window->display();
}
Voilà, j'espère que c'est assez clair et concis :-\
Il y a peut être quelques incohérences, mais le tout est placé dans plusieurs méthodes d'une classe, donc bon...
EDIT : Et avec ce code, je n'ai ni rond vert, ni texte...
Oui oui je me doute, et je te remercie ! :)
En fait, j'ai fait mieux, j'ai fait un nouveau projet, j'ai minimaliser mon code pour ne garder que ceci (j'ai essayé de garder les mêmes libs) :
#include <GL/glew.h>
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(1024, 768), "SFML works!");
window.setVerticalSyncEnabled(false);
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
// Declare and load a font
sf::Font font;
font.loadFromFile("arial.ttf");
// Create a text
sf::Text text("Hello");
text.setFont(font);
text.setCharacterSize(30);
text.setStyle(sf::Text::Bold);
text.setColor(sf::Color::Red);
text.setPosition(100,100);
GLenum code;
/* initialisation de GLEW */
code = glewInit();
if(code != GLEW_OK)
{
fprintf(stderr, "impossible d'initialiser GLEW : %s\n",
glewGetErrorString(code));
}
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.pushGLStates();
window.draw(shape);
window.draw(text);
window.popGLStates();
window.display();
}
return 0;
}
Et là tout fonctionne correctement, alors que sur mon projet principal, non... :(
Ça commence à m'énerver xD !
Je vais continuer de chercher, merci encore :)
En fait, ça foire quand cette fonction est exécutée :
int init_resources()
{
GLfloat cube_vertices[] = {
// front
-1.0, -1.0, 1.0,
1.0, -1.0, 1.0,
1.0, 1.0, 1.0,
-1.0, 1.0, 1.0,
// back
-1.0, -1.0, -1.0,
1.0, -1.0, -1.0,
1.0, 1.0, -1.0,
-1.0, 1.0, -1.0,
};
glGenBuffers(1, &vbo_cube_vertices);
glBindBuffer(GL_ARRAY_BUFFER, vbo_cube_vertices);
glBufferData(GL_ARRAY_BUFFER, sizeof(cube_vertices), cube_vertices, GL_STATIC_DRAW);
GLfloat cube_colors[] = {
// front colors
1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0,
1.0, 1.0, 1.0,
// back colors
1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0,
1.0, 1.0, 1.0,
};
glGenBuffers(1, &vbo_cube_colors);
glBindBuffer(GL_ARRAY_BUFFER, vbo_cube_colors);
glBufferData(GL_ARRAY_BUFFER, sizeof(cube_colors), cube_colors, GL_STATIC_DRAW);
GLushort cube_elements[] = {
// front
0, 1, 2,
2, 3, 0,
// top
1, 5, 6,
6, 2, 1,
// back
7, 6, 5,
5, 4, 7,
// bottom
4, 0, 3,
3, 7, 4,
// left
4, 5, 1,
1, 0, 4,
// right
3, 2, 6,
6, 7, 3,
};
glGenBuffers(1, &ibo_cube_elements);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo_cube_elements);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(cube_elements), cube_elements, GL_STATIC_DRAW);
GLint link_ok = GL_FALSE;
GLuint vs, fs;
if ((vs = create_shader("cube.v.glsl", GL_VERTEX_SHADER)) == 0) return 0;
if ((fs = create_shader("cube.f.glsl", GL_FRAGMENT_SHADER)) == 0) return 0;
program = glCreateProgram();
glAttachShader(program, vs);
glAttachShader(program, fs);
glLinkProgram(program);
glGetProgramiv(program, GL_LINK_STATUS, &link_ok);
if (!link_ok) {
fprintf(stderr, "glLinkProgram:");
print_log(program);
return 0;
}
const char* attribute_name;
attribute_name = "coord3d";
attribute_coord3d = glGetAttribLocation(program, attribute_name);
if (attribute_coord3d == -1) {
fprintf(stderr, "Could not bind attribute %s\n", attribute_name);
return 0;
}
attribute_name = "v_color";
attribute_v_color = glGetAttribLocation(program, attribute_name);
if (attribute_v_color == -1) {
fprintf(stderr, "Could not bind attribute %s\n", attribute_name);
return 0;
}
const char* uniform_name;
uniform_name = "mvp";
uniform_mvp = glGetUniformLocation(program, uniform_name);
if (uniform_mvp == -1) {
fprintf(stderr, "Could not bind uniform %s\n", uniform_name);
return 0;
}
return 1;
}
Donc si je résume ;
- sans cette fonction, j'ai mon texte ;
- avec cette fonction, j'ai une fenêtre avec mes dessins OpenGL ;
- pas d'erreur de compilation ;
- pas de message particulier dans la console ;
En fait, quand je disais que quand je fais de la 2D ça fonctionne, c'est simplement qu'en fait, je n'utilisais pas les Shaders pour la 2D. Par contre, j'utilise les Shaders pour la 3D, et là ça foire...
Donc ça serait les Shaders ? :-\
EDIT : En fait, je me trompe totalement : quand je faisais de la 2D (et que ça foirait pas), j'utilisais aussi deux shaders, mais que je rentrais moi même dans un tableau de char (sans passer par une ouverture de fichier), donc ça ne peut pas être ça non plus... :( Grr