Jump to content
  • Advertisement
Sign in to follow this  
ne_coco

problem with loading HDR image using pbrt

This topic is 2490 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone
I'm trying to load an HDR image into my program using pbrt libaray( 3rdparty), I include the associated libraries in "Additional include directories" of my solution. I'm using visual studio 2010. here is my code to load the image:
bool loadTexture(const char *path)
{
Imf::Rgba * pixelBuffer;
GLuint width;
GLuint height;
try
{
Imf::RgbaInputFile in(path);

Imath::Box2i win = in.dataWindow();
width = win.max.x - win.min.x+1;
height = win.max.y - win.min.y+1;
Imath::V2i dim(win.max.x - win.min.x + 1,
win.max.y - win.min.y + 1);

pixelBuffer = new Imf::Rgba[dim.x * dim.y];


int dx = win.min.x;
int dy = win.min.y;

int order = in.lineOrder();

in.setFrameBuffer(pixelBuffer - dx - (dy * dim.x), 1, dim.x);
in.readPixels(win.min.y, win.max.y);
}
catch(Iex::BaseExc & e)
{
std::cerr << e.what() << std::endl;

delete[]pixelBuffer;
return false;
}
//GLuint texture;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D /*GL_TEXTURE_RECTANGLE*/, texture);

glTexParameteri(GL_TEXTURE_2D , GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D , GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D , GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D , GL_TEXTURE_WRAP_T, GL_CLAMP);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

glTexImage2D(GL_TEXTURE_2D , 0, GL_RGBA16F, width, height, 0, GL_RGBA, GL_HALF_FLOAT, pixelBuffer);

delete[]pixelBuffer;
return true;


}

I got this linking errors:
error LNK1120:7 unresoved externals
error LNK2019:unresoved external symbol "int_cdecl Imf::globalTreadCount(void)(?globalTreadCount@Imf@@yahXZ)refrenced in function "bool_cdeclloadTexture(char const*)"(?loadTexture@@YA_NPBD@Z)
And 4 more linker errors like this.

Thanks in advance! smile.png

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!