Damn that 4kbytes of leak memory
-
Hi again fellows I have this function in my code: void ImprimeTexto(unsigned int iFont, const char* cValue) { if(iFont == 0) return; glEnable(GL_BLEND); glPushAttrib(GL_LIST_BIT); glListBase(iFont - 32); glCallLists(strlen(cValue), GL_UNSIGNED_BYTE, cValue); glPopAttrib(); glDisable(GL_BLEND); } Because of my const char cValue variable I have a leak memory of 4kbytes. I need to pass a variable of type const char because the glCallLists(an OpenGL function) needs. The last parameter is a pointer to GLVoid. Here is the function signature: GLAPI void APIENTRY glCallLists( GLsizei n, GLenum type, const GLvoid *lists ); I've tried to pass a std::string but the function doesn't works :doh:. Guys, can you help me in this?? Thanks a lot
-
Hi again fellows I have this function in my code: void ImprimeTexto(unsigned int iFont, const char* cValue) { if(iFont == 0) return; glEnable(GL_BLEND); glPushAttrib(GL_LIST_BIT); glListBase(iFont - 32); glCallLists(strlen(cValue), GL_UNSIGNED_BYTE, cValue); glPopAttrib(); glDisable(GL_BLEND); } Because of my const char cValue variable I have a leak memory of 4kbytes. I need to pass a variable of type const char because the glCallLists(an OpenGL function) needs. The last parameter is a pointer to GLVoid. Here is the function signature: GLAPI void APIENTRY glCallLists( GLsizei n, GLenum type, const GLvoid *lists ); I've tried to pass a std::string but the function doesn't works :doh:. Guys, can you help me in this?? Thanks a lot
pass a std::String, and then use the c_str() function to get a char * to pass into the OpenGL function. Christian Graus - Microsoft MVP - C++
-
Hi again fellows I have this function in my code: void ImprimeTexto(unsigned int iFont, const char* cValue) { if(iFont == 0) return; glEnable(GL_BLEND); glPushAttrib(GL_LIST_BIT); glListBase(iFont - 32); glCallLists(strlen(cValue), GL_UNSIGNED_BYTE, cValue); glPopAttrib(); glDisable(GL_BLEND); } Because of my const char cValue variable I have a leak memory of 4kbytes. I need to pass a variable of type const char because the glCallLists(an OpenGL function) needs. The last parameter is a pointer to GLVoid. Here is the function signature: GLAPI void APIENTRY glCallLists( GLsizei n, GLenum type, const GLvoid *lists ); I've tried to pass a std::string but the function doesn't works :doh:. Guys, can you help me in this?? Thanks a lot
I suppose that you dynamically allocate the list array before calling ImprimeTexto, and then you forget to deallocate it.