Results 1 to 2 of 2

Thread: Unknown problem :S

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2015
    Posts
    17

    Exclamation Unknown problem :S

    Here a part of my game enigne, it should read two files with the same fstream. It gave me runtime errors like "ndvoglv64.dll unhandled exception" or my application "start a breakpoint" (I don't know how can I translate it in english, sorry ). Anyway, here's the code:

    Oh, I forgot. I save the data contains in the two file in two struct one for each. I tried to delete the part of code where I save the data and the runtime compiler doesn't give me any error.
    So, i think that i send too many operation to the cpu D:

    Code :
    	std::fstream file;
    	file.open("font\\font.fnt");
    	{
    		if (file.is_open())
    		{
    			unsigned int width, height;
    			texture.size(width, height);
     
    			std::string line;
    			std::vector<std::string> data;
     
    			while (std::getline(file, line))
    			{
    				data = split(line, ',');
    				letters[std::stoi(data[ID])] = new Letter(
    					std::stof(data[X]) / width,
    					std::stof(data[Y]) / height,
    					std::stof(data[WIDTH]) / width,
    					std::stof(data[HEIGHT]) / height,
    					std::stof(data[XOFFSET]) / width,
    					std::stof(data[YOFFSET]) / height,
    					std::stof(data[XADVANCE]) / width,
    					std::stoi(data[PAGE]),
    					std::stoi(data[CHNL])
    				);
    			}
    		}
    	}
    	file.close();
     
    	file.open("font\\color.fnt");
    	{
    		if (file.is_open())
    		{
    			std::string line;
    			std::vector<std::string> data;
     
    			for (unsigned short i = 0; (i < COLORNUMBER) && std::getline(file, line); i++)
    			{
    				data = split(line, ',');
    				colors[i] = new Color(glm::vec3(
    					std::stof(data[R]) / 255.0f,
    					std::stof(data[G]) / 255.0f,
    					std::stof(data[B]) / 255.0f
    					));
    			}
    		}
    	}
    	file.close();

  2. #2
    Newbie Frequent Contributor
    Join Date
    Mar 2016
    Posts
    896
    The crash seems to happen in part of the nvidia driver, but I don't see any OpenGL calls from the code you posted so my guess is that you are overwriting memory somewhere in your program (e.g. by writing past the end of an array or something similar) causing it to crash later. You should run your program under a debugger, examine the call stack at the point where it crashes and see which of your data structures are modified in nearby code - if you compare array indices and other sizes with what you expect them to be you can often find the out of bounds access.

    Your problem is not really related to OpenGL as far as I can tell, as such you have a better chance of getting useful answers by posting on a general programming forum.

Similar Threads

  1. Unknown White screen
    By Joshhua5 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-19-2011, 02:50 AM
  2. Unknown problem(updated)
    By Joshhua5 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-18-2011, 04:01 AM
  3. gl_ViewportIndex unknown on GTX 580
    By jkl in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 11-22-2010, 03:09 AM
  4. unknown builtin parameter
    By -NiCo- in forum OpenGL: GLSL
    Replies: 2
    Last Post: 09-17-2004, 09:46 AM
  5. help!! unknown bug?? GL ERROR : invalid value
    By mochi in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 05-27-2003, 07:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean