• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 8660
  • Last Modified:

3DS Max models needed to import into OpenGL using Dev C++ GUI compiler

I am currently devloping a game which requires various 3ds max models to be imported into the game where they can then be manipulated by the program.

After a good search on the internet I found 3D Exploration. Using this I was able to convert the .3ds files into CPP code.

Having told 3D Exploration to covert as a Application, I then compiled the code. I got the following errors:

HopeOpenGL/grass.cpp:15256:63: warning: multi-character character constant
HopeOpenGL/grass.cpp: In function `BOOL ScaleImage(DIB2D&, GLTXTLOAD&)':
HopeOpenGL/grass.cpp:15322: error: `GL_BGR_EXT' undeclared (first use this function)
HopeOpenGL/grass.cpp:15322: error: (Each undeclared identifier is reported only once for each function it appears in.)

HopeOpenGL/grass.cpp:15328: error: `GL_BGRA_EXT' undeclared (first use this function)

HopeOpenGL/grass.cpp: In function `void SetDCPixelFormat(HWND__*, HDC__*)':
HopeOpenGL/grass.cpp:15635: error: non-lvalue in assignment

Any help at resolving these errors and explaining to me how I might prevent them with the future meshes would be appreciated
0
richardwhiuk
Asked:
richardwhiuk
  • 2
  • 2
1 Solution
 
richardwhiukAuthor Commented:
I managed to fix some of the errors. It appears on a W32 environment I needed to add glext.h to be includes. The errors and warnings now are:

HopeOpenGL/grass.cpp:15257:63: warning: multi-character character constant
HopeOpenGL/grass.cpp: In function `void SetDCPixelFormat(HWND__*, HDC__*)':
HopeOpenGL/grass.cpp:15636: error: non-lvalue in assignment

15255 - 15257 code lines read:

       BITMAPFILEHEADER bmfh;
       ReadFile(hfile,&bmfh,sizeof(BITMAPFILEHEADER),&readed,0);
       if((readed==sizeof(BITMAPFILEHEADER)) && (bmfh.bfType=='BM'))

15635 - 15636 code lines read:

        (LPLOGPALETTE) lpPalette = (LPLOGPALETTE)HeapAlloc (hHeap, 0,
            sizeof (LOGPALETTE) + (nColors * sizeof (PALETTEENTRY)));

0
 
shirsoftCommented:
a dumb guess but u may try removing the first LPLOGPALETTE type cast ... i haven't seen something like that

The warning as u might be knowing is coz of the bitmap header where it tries to compare it with 'B'<<8+'M', i think if use it in this fashion the warning will go
0
 
sunilsiCommented:
i haven't try this but there are many tutorial and source code aviliable on net to open the 3ds file in openGL then y u r not trying that. that will be very useful.
0
 
richardwhiukAuthor Commented:
Can you name any specific websites?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now