Hi guys,
I am having trouble showing anything on the screen. Can someone try to copy this and try to run in and see what you can get. I am using Dev-C Bloodsheed and trying simply to read tif image and then show it on the screen. I have image in same directory as my program.
Even when i delete the image from directory i cant even get error message to the screen (printf("Error");
Can anyone help me with this

Code :
#include <stdlib.h>
#include <GL/gl.h>
#include <stdio.h>
#include <GL/glut.h>
#include <malloc.h>
#include <FreeImage.h>
typedef struct {
	GLubyte r, g, b;
} pixel;
//the global structure
typedef struct {
	pixel *data;
	int w, h;
} glob;
glob global;
pixel *read_img(char *name, int *width, int *height) {
	FIBITMAP *image;
	int i,j,pnum;
	RGBQUAD aPixel;
	pixel *data;
	if((image = FreeImage_Load(FIF_TIFF, name, 0)) == NULL) {
		return NULL;
	*width = FreeImage_GetWidth(image);
	*height = FreeImage_GetHeight(image);
	data = (pixel *)malloc((*height)*(*width)*sizeof(pixel *));
	for(i = 0 ; i < (*height) ; i++) {
		for(j = 0 ; j < (*width) ; j++) {
			FreeImage_GetPixelColor(image, j, i, &amp;aPixel);
			data[pnum].r = (aPixel.rgbRed);
			data[pnum].g = (aPixel.rgbGreen);
			data[pnum++].b = (aPixel.rgbBlue);
	return data;
int main(int argc,char** argv){
    global.data = read_img("img.tif", &amp;global.w, &amp;global.h);
    if (global.data == NULL){
       return 1;             
    glutCreateWindow("Simple Display");