SciTech MGL 4.05
Troubleshooting
Adapted from the MGL Newsgroup
Tuesday, May 25, 1999
Contents
I'm missing mglver.h and scitech.h!
To use SciTech MGL you'll need to install three packages. The BASE install
containing all the drivers, the COMPILER install for the headerfiles and
the PATCH install to obtain some missing drivers.
Can i commercially sell products made with SciTech MGL?
Under the license agreement, you can distribute commercial applications
that were created using SciTech MGL. If your product is itself a library, then
you would need to contribute the source to any changes that you make to *MGL*
back to the MGL community. This ensures that MGL continues to evolve for the
benefit of everyone.
What's new in MGL 4.05?
You can read the "what's new" information in \SCITECH\DOC\MGL\README.WRI.
The readme covers 3->4->4.01->4.02->4.03->4.04->4.05.
What does "unresolved external symbol _main" mean?
The error message "unresolved external symbol _main" occurs when you define
a wrong entry point for your program. There are two basic rules that can eliminate this
message.
- If your application is intented to run on DOS or is a console mode application in Windows, the entry point of your application should be int main().
- If your program runs on GUI-ed Windows, the entry point should be int WinMain().
Note that the main entry point of your program doesn't have to be on the first line of
your sourcecode.
Why can't I use 8 bit modes when my Windows is set to 24 bits?
Windirect drivers do care about the windows bit depth. If you run an MGL
demo and select 'Use WinDirect Only', the available bit depths will change
depending on the current windows display properties-- at least that's what
happens on all of our systems around here. (The mode list is built at
program init and won't change while the MGL demo is still running, so it's
not so strange that you can still get 24 bits after you changed the windows
display to 16 bit.)
DirectDraw drivers don't care about the windows bit depth, so if you have no
modes available at certain bit depths, then it suggests your DirectDraw
drivers are amiss. You can check this by running an MGL demo and selecting
'Use DirectDraw Only' in the options menu. See any video modes? If not,
then DirectX doesn't support your card, or else it isn't installed
correctly... and so you should take Remy's advice. I think 6.1 is still in
beta, isn't it? You can get the 6.0 core install from
http://www.microsoft.com/windows/downloads/
How to detect if directX is installed?
Although this goes beyond the SciTech MGL i will answer this problem anyway.
You will have to use a DirectX API specific function:
LPDIRECTDRAW lpdd;
if ( FAILED (DirectDrawCreate(NULL, &lpDD, NULL)))
{
// DirectX isn't installed.
}
And how about DirectX version checking?
For some reason programmers are possessed by an uncontrollable desire
to know what version of DirectX they're working with. They write code
that pokes about the system, checking for this file or that or some other
"version-specific" feature. In most cases this is a recipe for disaster.
The best approach is not to write code that checks for the DirectX version
at all - if you think about it, you're probably not actually concerned
with the version but rather the availability of a specific interface that
exposes the functionality you require. Remember, each revision of DirectX
results in a new set of interfaces, and each version includes all the
previous interfaces. This enables you to use the power of COM's version
control:
LPDIRECTDRAW lpDD;
LPDIRECTDRAW2 lpDD2;
if ( FAILED(lpDD->QueryInterface(IID_IDIRECTDRAW2,
( LPVOID *)&lpDD2)))
{
// No DirectX 5 features present
}
How to compile MGL for Windows programs via DJGPP?
It's not possible to compile Windows programs with DJGPP, because DJGPP is
a dos and unix compiler. There's a library for DJGPP however, called
RSXDJ. RSXDJ
brings some Windows magic to your dos compiler, thus enabling the creation of
full interactive GUI applications. Although the distribution of latter tool
is broken, people developed some patches and HOW-TOs for RSXDJ. See for more
in the DJGPP-specific homepage.
Don't need to link opengl.lib in DirectGL?
Remember to copy over any necessary DLL's like sgiglu.dll .The 'Unable to Load OpenGL'
error most often occurs when certain DLL's can't be found. The MGL dynamically links to the OpenGL drivers in the system, which
allows us to auto-switch between the Microsoft, SGI and Mesa OpenGL
libraries. Hence make sure you have all the SGI and Microsoft libraries
on the path so that we can load those DLL's correctly...