03-16-2018, 07:51 PM
(This post was last modified: 03-16-2018, 07:52 PM by pahendriks.)
(03-16-2018, 07:44 PM)pahendriks Wrote:(03-16-2018, 07:29 PM)Brian Beuken Wrote: Its not an error in the book Patrick, there's actually a fault in the way you typed it in, i would really like you to review your code and try to spot the error yourself, but if you get totally stuck (it can happen) I'll tell you in an hour.
but as this is not an actual error in the book, I will remove post when you find the problem
found it, missing &.
But no rectangle after compiling.
Can it be that this part has errors? Is the red code on the right place?
#include "MyFiles.h"
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
MyFiles::MyFiles()
{}
MyFiles::~MyFiles()
{}
char* MyFiles::Load(char const *filename, int* width, int* height)
{
unsigned char *data = stbi_load(filename, width, height, &comp, 4);
MyFiles FileHandler;
int Width, Height;
char* OurRawData = FileHandler.Load((char*)"../Lenna.png", &Width, &Height);
if (OurRawData == NULL) printf("We failed to load\n");
return (char*) data;
}