MasteR Posted September 8, 2010 Share Posted September 8, 2010 Does anyone have experience in manually loading images and using the surface data as an OpenGL texture? I'm writing a DDS loader: In particular I need to use to OpenGL command glCompressedTexImage2D, I receive a linker error when trying to use it. The problem is I have no idea where the function definition is and therefore no idea which lib, dll, header, etc to include. Any thoughts? Anyone written their own DDS image loader (or other formats) before, if so I'd very much like to pick your brains and receive some mentoring. Quote AMD Athlon 64 X2 Dual Core 6000+ (3.0 GHz) 4 GB DDR2 RAM 2 x NVIDIA GeForce 9500 GT 512 MB (SLI 1.0 GB) Windows XP Pro Link to comment Share on other sites More sharing options...
Canardia Posted September 8, 2010 Share Posted September 8, 2010 You need to include the glew library: http://glew.sourceforge.net/ I would use the image loader from SDL, since I need SDL in any game anyway (joystick support, network support). Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
MasteR Posted September 8, 2010 Author Share Posted September 8, 2010 I wanted to avoid using 3rd party libraries, but that’s exactly what glew seems to be I may as well use OpenIL if that’s the case *EDIT* Let’s keep this ball rolling. My issue is not the loading of the DDS file as that was simple enough. However assistance is needed in using this collected data to create an OpenGL texture. Anyone created their own OpenGL image and texture loader...care to assist? Quote AMD Athlon 64 X2 Dual Core 6000+ (3.0 GHz) 4 GB DDR2 RAM 2 x NVIDIA GeForce 9500 GT 512 MB (SLI 1.0 GB) Windows XP Pro Link to comment Share on other sites More sharing options...
Laurens Posted September 8, 2010 Share Posted September 8, 2010 I wouldn't know about creating a DDS loader but regarding your linker error I believe you need to include opengl32.lib to your project's "Additional Dependencies" (linker options). Cheers! Quote Link to comment Share on other sites More sharing options...
flachdrache Posted September 8, 2010 Share Posted September 8, 2010 glew basically helps to make ARB and EXT gl_extensions available iirc. However, you could take a look into the "glext.h" for which extension the "CompressedTexImage2D" command would ask for and implement the extension yourself. There are plenty of tutorials how one would implement FrameBufferObjects etc. - its all the same "basically". imho 3rd party libs are great if not to huge or simply redundant i.e. horrible to write a own openGL renderer w/o such thinks like glew i assume. [edit] glCompressedTexImage2D (OpenGL 1.3, ARB_texture_compression) Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
MasteR Posted September 8, 2010 Author Share Posted September 8, 2010 After a look through glew.h I was able to define the function using: PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2D; Seem right? The program compiles and runs, but no texture shows, this could be caused by: Incorrectly reading the surface pixel data Incorrectly creating an OpenGL texture Incorrectly texture mapping a quad anyone done this before ( manually reading an image file and creating an OpenGL texture), willing to look over my code and get it sorted out. I'm very much new to OpenGL. Quote AMD Athlon 64 X2 Dual Core 6000+ (3.0 GHz) 4 GB DDR2 RAM 2 x NVIDIA GeForce 9500 GT 512 MB (SLI 1.0 GB) Windows XP Pro Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.