Jump to content
  • Advertisement

Syrinth

Member
  • Content Count

    31
  • Joined

  • Last visited

Community Reputation

100 Neutral

About Syrinth

  • Rank
    Member
  1. and this is why I really hate the openGL tutorials. They don't bother telling me I need to do this stuff. Ok, going to go look at that. Thanks a bunch Edit: Nope, nothing changed. Also, no I haven't removed any glu code. The only code I removed was a few lines of glOpenWindowHint that were causing the program to not run.
  2. Not doing any shaders right now since the triangle wouldn't draw when it said it was supposed to. Do I need to have shaders before I can even draw a blank white triangle? O.o
  3. So I've posted here before trying to get this tutorial to even compile and I've gotten that far. I had to take a break in attempting the infuriating mess that is OpenGL tutorials due to real life issues but I really want to dive back into this. I'm on step 2 *yay, eyeroll* and the code compiles and runs, but all I get is a dark blue colored screen and no triangles being drawn. This code is pretty much copied and pasted from the tutorial except for what I needed to remove in order to have it run on my system. Can anyone see the problem? // OpenGL.cpp : Defines the entry point for the console application. // #include <windows.h> #include <stdio.h> #include <stdlib.h> #include <GL/glew.h> #define GLFW_DLL #include <GL/glfw.h> int main() { // Initialise GLFW if( !glfwInit() ) { fprintf( stderr, "Failed to initialize GLFW\n" ); return -1; } glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 4); glfwOpenWindowHint(GLFW_WINDOW_NO_RESIZE,GL_TRUE); // Open a window and create its OpenGL context if( !glfwOpenWindow( 1024, 768, 0,0,0,0, 32,0, GLFW_WINDOW ) ) { fprintf( stderr, "Failed to open GLFW window\n" ); glfwTerminate(); return -1; } // Initialize GLEW if (glewInit() != GLEW_OK) { fprintf(stderr, "Failed to initialize GLEW\n"); return -1; } glfwSetWindowTitle( "Playground" ); // Ensure we can capture the escape key being pressed below glfwEnable( GLFW_STICKY_KEYS ); // Dark blue background glClearColor(0.0f, 0.0f, 0.3f, 0.0f); // An array of 3 vectors which represents 3 vertices static const GLfloat g_vertex_buffer_data[] = { -1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, }; // This will identify our vertex buffer GLuint vertexbuffer; // Generate 1 buffer, put the resulting identifier in vertexbuffer glGenBuffers(1, &vertexbuffer); // The following commands will talk about our 'vertexbuffer' buffer glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer); // Give our vertices to OpenGL. glBufferData(GL_ARRAY_BUFFER, sizeof(g_vertex_buffer_data), g_vertex_buffer_data, GL_STATIC_DRAW); do{ glClear( GL_COLOR_BUFFER_BIT ); // 1rst attribute buffer : vertices glEnableVertexAttribArray(0); glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer); glVertexAttribPointer( 0, // attribute 0. No particular reason for 0, but must match the layout in the shader. 3, // size GL_FLOAT, // type GL_FALSE, // normalized? 0, // stride (void*)0 // array buffer offset ); // Draw the triangle ! glDrawArrays(GL_TRIANGLES, 0, 3); // From index 0 to 3 -> 1 triangle glDisableVertexAttribArray(0); // Swap buffers glfwSwapBuffers(); } // Check if the ESC key was pressed or the window was closed while( glfwGetKey( GLFW_KEY_ESC ) != GLFW_PRESS && glfwGetWindowParam( GLFW_OPENED ) ); // Close OpenGL window and terminate GLFW glfwTerminate(); return 0; }
  4. That did it! Thank you so much!
  5. Well that's completely depressing... I'm sure I updated my graphics drivers but will check again.
  6. Correction, no error messages aside from the ones that get triggered directly in the code Unable to create OpenGL Context Unable to recreate GLFW Window Failed to open GLFW window
  7. Still terminates at the same location and in the exact same way, No error messages.
  8. Hmmm, nope. Still failing O.o
  9. Thanks a lot for the help. I'm going to watch the video even though I know how to debug since I could use the brushup. I always wondered what the difference between the various projects was. *sigh* would it scare you to hear I actually graduated with a degree in Comp Sci and Video Game Design? Starting to think my school was a massive derp...
  10. Haha, I just ran off to take a shower myself. I know, although temporarily forgot and was trying to do some fileIO outputs to se wtf was going on. Trying now. Either way, I need to leave the house for a few hours and get some stuff done. Thank you so much for all the help and I'll probably be flailing at you when I get back :/ Just checked. This fails // Open a window and create its OpenGL context if( !glfwOpenWindow( 1024, 768, 0,0,0,0, 32,0, GLFW_WINDOW ) ) { fprintf( stderr, "Failed to open GLFW window\n" ); glfwTerminate(); return -1; }
  11. Whew, so close. I run the program through cmd, nothing changes. It runs, and there's no output in the cmd window.
  12. Should reiterate, it opens and then immediately closes...
  13. Just added glfw.dll and glew32.dll to my windows/system 32 folder. It runs now. However, the window just opens and closes... doesn't do anything else and I'm reasonably certain it's supposed to...
  14. So I get the following: 1>mt.exe : general error c101008a: Failed to save the updated manifest to the file "Debug\OpenGL.exe.embed.manifest". The parameter is incorrect. then if I build it again it succeeds, but when I run it, it says I'm missing the glfw.dll O.o I just checked my folders... I have it...
  15. BTW, thank you so much for helping me with this. This has been a source of stress for lover a month. Ok... so now we're at... 1>Main.obj : error LNK2019: unresolved external symbol _glfwGetWindowParam referenced in function _WinMain@16 1>Main.obj : error LNK2019: unresolved external symbol _glfwGetKey referenced in function _WinMain@16 1>Main.obj : error LNK2019: unresolved external symbol _glfwSwapBuffers referenced in function _WinMain@16 1>Main.obj : error LNK2019: unresolved external symbol _glfwEnable referenced in function _WinMain@16 1>Main.obj : error LNK2019: unresolved external symbol _glfwSetWindowTitle referenced in function _WinMain@16 1>Main.obj : error LNK2019: unresolved external symbol _glfwTerminate referenced in function _WinMain@16 1>Main.obj : error LNK2019: unresolved external symbol _glfwOpenWindow referenced in function _WinMain@16 1>Main.obj : error LNK2019: unresolved external symbol _glfwOpenWindowHint referenced in function _WinMain@16 1>Main.obj : error LNK2019: unresolved external symbol _glfwInit referenced in function _WinMain@16 1>F:\My Documents\Coding\C++\OpenGL\Debug\OpenGL.exe : fatal error LNK1120: 9 unresolved externals
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!