PDA

View Full Version : how to set opengl in borland c++ 5.0



abhiboy007
06-20-2001, 03:17 AM
please tell me how to set opengl window using borland c++ 5.0.
i've all related files such as
glut.h gl.h, all libs and dlls also

ffish
06-20-2001, 03:34 AM
The files you've downloaded are built with/for Visual C++ so what you have to do is use a Borland utility called imlib (I think) and rebuild the libraries. Anyway, I'm not familiar with Borland's compiler but this question gets asked very frequently. Do a search on this board for "Borland" and you'll find the answer.

Tron
06-21-2001, 02:08 AM
u got the free borland compiler? everything needed is already included (OpenGL-header/libs, winapi-headers/libs, even MFC and directx-stuff ****** [put in colorful, disgusting statement])

and don't forget to use the -tW compile-option, 'cause u want to create a windoze-app (winmain instead of main, m$-crap)

i'd give u an example, but i've no basic stuff availible right now, if u really want one i could code u something, but try nehe's tut first, it's a really good start

[This message has been edited by Tron (edited 06-21-2001).]

abhiboy007
06-21-2001, 02:47 AM
Originally posted by Tron:
u got the free borland compiler? everything needed is already included (OpenGL-header/libs, winapi-headers/libs, even MFC and directx-stuff ****** [put in colorful, disgusting statement])

and don't forget to use the -tW compile-option, 'cause u want to create a windoze-app (winmain instead of main, m$-crap)

i'd give u an example, but i've no basic stuff availible right now, if u really want one i could code u something, but try nehe's tut first, it's a really good start

[This message has been edited by Tron (edited 06-21-2001).]


thanks tron, i tried nehe's tut long ago it is mainly in vc++ so i want a code in c or c++

Tron
06-21-2001, 03:35 AM
there SHOULD (never know what's m$ doing) be no difference between vc++ and c++ (i.e. there's no "v"c++, visual or not, it's c++)
IF u don't count pragmas and MFC, which ... emmm ... ignores some c++ standards

nehe's tuts should work on borland to (i remeber there were some conversions to borland c++, but i think they used glut)

Deiussum
06-21-2001, 06:52 AM
First of all, Nehe's tutorials are Win32, which isn't specific to VC++. Borland should support the Win32 API as well.

Second, as Tron already pointed out, VC++ is NOT a separate language from C++. Even MFC can't be considered separate from C++ because it is just a set of C++ classes! (Do you consider Borland as not being C++ because it uses it's own wrapper classes? I think not.) They use macros to do things like message mapping, but those macros still follow C/C++ conventions. So far as having different pragmas, so what? The #pragma directive is really MEANT for doing compiler specific things.

From MSDN (Ok, it might be a little biased coming from MS, but It's still an accurate statement)


The #pragma directives offer a way for each compiler to offer machine- and operating-system-specific features while retaining overall compatibility with the C and C++ languages. Pragmas are machine- or operating-system-specific by definition, and are usually different for every compiler.


Sorry... I'll end my rant now. People trying to claim VC++ is a different language is kind of a pet peave with me. http://www.opengl.org/discussion_boards/ubb/smile.gif

Tron
06-21-2001, 09:34 AM
i know that visual c++ is just normal c++
and i know that pragmas are meant to be compiler-specific (which i consider as very ugly)

BUT the MFC is NOT fully c++-standard
there's a special compiler option for the borland compiler to use MFC, that's typical m$ crap! (;



(Command-line switches: -VF)

Turn this option on to compile code that is compatible with the Microsoft foundation classes (MFC). Among other things, the compiler makes the following adjustments to be compatible with MFC:

Accepts spurious semicolons in a class scope
Allows anonymous structs
Uses the old-style scoping resolution in for loops
Allows methods to be declared with a calling convention, but leaves off the calling convention in the definition
Tries the operator new if it cannot resolve a call to the operator new[*]
Lets you omit the operator & on member functions
Allows a const class that is passed by value to be treated as a trivial conversion, not as a user conversion

Allows you to use a cast to a member pointer as a selector for overload resolution, even if the qualifying type of the member pointer is not derived from the class in which the member function is declared
Accepts declarations with duplicate storage in a class, as in

extern "C" typedef

Accepts and ignores #pragma comment(linker, "...") directives

Note: The -VF option is not compatible with – A.

Setting the -VF option implies that the –Vd switch (old style scoping in for loops) is on. If you turn on the –VF switch, you do not need to turn on – Vd.

Default = OFF

Deiussum
06-21-2001, 09:57 AM
All those things you listed there have to do with things in the VC++ compiler that isn't completly up to the ANSI standards. None of them are specific to MFC. You probably need to use that because code written in VC++ with MFC will most likely have some of that stuff. Even when I was programming glut apps to run under both Windows and Linux I had to watch out for things like the scope resolution of for loops.

I am more than willing to admit that the compiler for VC++ is a bit outdated with regards to some things. It still has about the best IDE available, though.