Archived

This topic is now archived and is closed to further replies.

Stephane Routelous

pb with gluScaleImage

Recommended Posts

Hi, I want to use gluScaleImage, but it doesn''t work, because I don''t have a rendering context ( I think it is the reason ). Here is the code that I have : // scale.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <windows.h> #include <iostream.h> #include <gl/gl.h> #include <gl/glu.h> #pragma comment(lib,"glu32.lib") #pragma comment(lib,"opengl32.lib") int main(int argc, char* argv[]) { //create a RGB image w=10 h=10 float* input = (float*)malloc(10*10*3*sizeof(float)); float* tmp = input; for ( int i = 0 ; i < 100 ; i++ ) { *tmp++ = i/100.0f; //red *tmp++ = i/100.0f; //green *tmp++ = i/100.0f; //blue } //create an image w=20 h=20 float* output = (float*)malloc(20*20*3*sizeof(float)); int ret = gluScaleImage(GL_RGB,10,10,GL_FLOAT,input,20,20,GL_FLOAT,output); cout << ret << endl; return 0; } What should I add to have this code working ? TIA, Stephane Routelous

Share this post


Link to post
Share on other sites