Closed Gabryx64 closed 3 years ago
I was trying to decode a png into a GLFWimage, but lodepng doesn't read files, even when putting a wrong filename it doesn't gives errors
This is my code:
void Window::setCursor(const char* filepath) { std::vector<unsigned char> imageData; unsigned width, height; unsigned error = lodepng::decode(imageData, width, height, filepath); if(error) { exit(-1); } unsigned char* pixels = imageData.data(); GLFWimage image; image.width = width; image.height = height; image.pixels = pixels; cursor = glfwCreateCursor(&image, 0, 0); if(cursor == NULL) { exit(-1); } glfwSetCursor(window, cursor); }
Probably it returns a blank or something array so that is why glfw doesn't give error too
After some debugging, if found out that the problem is glfw, not lodepng
I was trying to decode a png into a GLFWimage, but lodepng doesn't read files, even when putting a wrong filename it doesn't gives errors
This is my code:
Probably it returns a blank or something array so that is why glfw doesn't give error too