• Advertisement

Atemu

Member
  • Content count

    19
  • Joined

  • Last visited

Community Reputation

263 Neutral

About Atemu

  • Rank
    Member

Personal Information

  1. Alright, thanks for your answers :)
  2. Hey,   I'm following a tutorial about OpenGL 4 and the author always use glDrawArrays (with simple shape) but I'm wondering how he could draw complex shape without using any Index Buffer ?
  3. Very strange problem

    Thank you for your help, I'm using GLM and I didn't know I could use the glm::vec3 in a VBO so that's why I tried to generate a float array of points extracted from the glm::vec3 vector. Everything is now working :)
  4. Very strange problem

    Well I tried to find where the problem is by using your idea (which I should have thought lol). The probleem seems to be with: float *points = cube.getArrayOfPoints(); And the code of that method: float *Mesh::getArrayOfPoints() { const int size = points_.size() * 3; float *array = new float[size]; int j = 0; for (int i = 0; i < size; i++) { array[j++] = points_[i].x; array[j++] = points_[i].y; array[j++] = points_[i].z; } return array; } As you can see my class Cube is inheriting from the class Mesh.
  5. Very strange problem

    To be honest, I've no idea where the problem is :(
  6. Hey,   When I'm trying to execute my program, I get this error: "malloc: *** error for object 0x100d8b770: pointer being freed was not allocated". I used gdb to see the stacktrace: #0  0x00007fff8c260866 in __pthread_kill () #1  0x00007fff8bcf135c in pthread_kill () #2  0x00007fff8c217bba in abort () #3  0x00007fff8b468093 in free () #4  0x0000000100001aae in Render::renderLoop () #5  0x0000000100001470 in RenderWindow::show () #6  0x0000000100000fab in main () The problem seems to come from the methode renderLoop() of the class Render. Here is the code of that method: void Render::renderLoop(GLFWwindow* window) { Cube cube; float *points = cube.getArrayOfPoints(); unsigned int vertexArrayObject = 0; glGenVertexArrays(1, &vertexArrayObject); glBindVertexArray(vertexArrayObject); unsigned int vertexBufferObject = 0; glGenBuffers(1, &vertexBufferObject); glBindBuffer(GL_ARRAY_BUFFER, vertexBufferObject); glBufferData(GL_ARRAY_BUFFER, cube.getSize() * 3 * sizeof(float), points, GL_STATIC_DRAW); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0); glEnableVertexAttribArray(0); glBindVertexArray(0); // Vertex Shader std::string vertex_shader_file = readShaderFile("shader/test_vs.glsl"); const char* vertex_shader = vertex_shader_file.c_str(); // Fragment Shader std::string fragment_shader_file = readShaderFile("shader/test_fs.glsl"); const char* fragment_shader = fragment_shader_file.c_str(); unsigned int vs = glCreateShader(GL_VERTEX_SHADER); glShaderSource(vs, 1, &vertex_shader, NULL); glCompileShader(vs); unsigned int fs = glCreateShader (GL_FRAGMENT_SHADER); glShaderSource(fs, 1, &fragment_shader, NULL); glCompileShader(fs); unsigned int shader_programme = glCreateProgram(); glAttachShader(shader_programme, fs); glAttachShader(shader_programme, vs); glLinkProgram(shader_programme); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); while (!glfwWindowShouldClose(window)) { // Wipe the drawing surface clear glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Viewport glViewport(0, 0, getWindowWidth(), getWindowHeight()); // Draw //draw(); glUseProgram(shader_programme); glBindVertexArray(vertexArrayObject); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glBindVertexArray(0); // Update other events like input handling glfwPollEvents(); // Put the stuff we've been drawing onto the display glfwSwapBuffers(window); } } I don't see where my pointer points is being freed :/ Would you have any idea ? Thanks in advance !
  7. Thank you so much !!! I removed the -c option accidentally :) It's now compiling !
  8. Hey,   I'm working on a small OpenGL project and I would like to use C++11 however when I'm trying to compile I get errors :/ Those errors aren't happening when I'm using C++98. g++ -std=c++11 -Wall -I/opt/local/include -Iinclude src/main.cpp -o src/main.o Undefined symbols for architecture x86_64:   "RenderWindow::init(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int)", referenced from:       _main in ccLk05Ex.o   "RenderWindow::show()", referenced from:       _main in ccLk05Ex.o   "RenderWindow::shutdown()", referenced from:       _main in ccLk05Ex.o   "RenderWindow::instance_", referenced from:       RenderWindow::getInstance()       in ccLk05Ex.o   "RenderWindow::RenderWindow()", referenced from:       RenderWindow::getInstance()       in ccLk05Ex.o ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status make: *** [src/main.o] Error 1 The content of my main.cpp: #include <iostream> #include "renderwindow.h" int main() {     RenderWindow *renderWindow = RenderWindow::getInstance();     renderWindow->init("OpenGL Framework", 640, 480);     renderWindow->show();     renderWindow->shutdown(); } My OS is Mac OS X 10.9 and I'm using GLEW, GLFW and GLM.   Would you have any idea why I got those errors ?   Thanks in advance !  
  9. D3D11CreateDevice failed

    Solution found for the D3D11_CREATE_DEVICE_DEBUG flag:
  10. D3D11CreateDevice failed

    No, that's Microsoft...
  11. D3D11CreateDevice failed

    Amazing... Look at the information of the update: http://support.microsoft.com/kb/2670838  
  12. D3D11CreateDevice failed

    I also installed the update yesterday :(
  13. Hello,   I have a huge problem. I can't run my program in Debug, I use the D3D11_CREATE_DEVICE_DEBUG when I want to initialize DX 11. However, it works in Release mode. I tried toreinstall the DirectX SDK but it's not successfull Yesterday everything was working fine and not today   The source code that initialize DX 11: UINT createDeviceFlags = 0; #if defined(DEBUG) || defined(_DEBUG) createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG; #endif D3D_FEATURE_LEVEL featureLevel; HRESULT hr = D3D11CreateDevice( 0, // default adapter md3dDriverType, 0, // no software device createDeviceFlags, 0, 0, // default feature level array D3D11_SDK_VERSION, &md3dDevice, &featureLevel, &md3dImmediateContext); if( FAILED(hr) ) { MessageBox(0, L"D3D11CreateDevice Failed.", 0, 0); DXTrace( __FILE__, __LINE__, hr, DXGetErrorDescription(hr), FALSE ); return false; } These are the information I get: First-chance exception at 0x7751c41f in SpinningCube.exe: Microsoft C++ exception: _com_error at memory location 0x0031ec88.. An undetermined error occurred hr=E_FAIL (0x80004005) Thanks in advance !
  14. [quote name='Atemu' timestamp='1358180060' post='5021432'] Few month ago I purchased the book "Introduction to game programming with DirectX 11" by Frank D. Luna and I'm reading it. [/quote] Can I reuse some elements from the book (source code, architecture) ? For example there is a GameTimer class that I would like to reuse ofr my project.
  15. I remember trying to recover the textures with the Revit API and after some search on Google I learned that you can't get the textures \o/ \o/ And of course, I didn't have access to the Autodesk Developper Network (too expensive)... Thanks for your advice ;)
  • Advertisement