TCC Learning Notes (iii) use examples

Source: Internet
Author: User

The use of TCC is exemplified by the use of the third party libraries, including: OpenGL, GMP, SDL, etc.

1.TCC using GLUT

Go to OpenGL to download http://www.opengl.org/resources/libraries/glut/Glutdlls37beta. zip.

If you can't download it, you can download Glutdlls37beta. zip from my web drive.

In addition, header files GL.h and GLU.h can be found in the compiler's directory. File Search please use software everything.

Place the GL.h, GLU.h, glut.h into the INCLUDE/GL directory under the TCC root directory and put the Glut.dll in the TCC root directory.

Use Tiny_impdef.exe to generate Opengl32.def, Glu32.def, glut.def from Opengl32.dll, Glu32.dll, Glut.dll, and into the Lib directory.

Glut.h Configuration modification: Append # <windows.h> to the front, and then remove the extra. lib suffix.

#include <windows.h>/* ... */ #pragma comment (lib, "winmm")/     * Link with Windows multimedia lib */#pragma comment (lib, "Opengl32 ")  /* Link with Microsoft OpenGL Lib */#pragma comment (lib," glu32 ")/     * link with OpenGL Utility Lib */< c9> #pragma comment (lib, "Glut32")/    * link with Win32 GLUT lib */

OpenGL Example GLSTRING.C test:

1#include <GL/glut.h>2#include <stdio.h>3 4 intMainintargcChar*argv[])5 {6Glutinit (&argc, argv);7Glutcreatewindow ("Test");8     ConstGlubyte *vendor, *renderer, *version, *EXTENSIONS;9VENDOR =glgetstring (Gl_vendor);Ten puts (VENDOR); OneRENDERER =glgetstring (gl_renderer); A puts (RENDERER); -VERSION =glgetstring (gl_version); - puts (VERSION); theEXTENSIONS =glgetstring (gl_extensions); - puts (EXTENSIONS); -     return 0; -}
View Code
$ Tcc-lglut-run GLGETSTRING.C

Not to be continued ....

TCC Learning Notes (iii) use examples

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.