GithubHelp home page GithubHelp logo

weikm / hello-glut Goto Github PK

View Code? Open in Web Editor NEW

This project forked from transmissionzero/hello-glut

0.0 0.0 0.0 11 KB

A very simple "Hello World!" GLUT application demonstrating how to write OpenGL applications in C with MinGW and MSVC.

Home Page: http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/

License: The Unlicense

C 51.09% Makefile 48.91%

hello-glut's Introduction

Hello GLUT

Table of Contents

Introduction

This application is an example Windows GUI application, written to demonstrate how to build freeglut applications with MinGW and MSVC. It accompanies the Using freeglut or GLUT with MinGW article on Transmission Zero.

The application demonstrates how to process key presses and how to display a basic shape in a window. It doesn't attempt to do anything fancy, as it's really just a "Hello world!" example.

Although the application targets freeglut, there's no reason why it can't use a compatible alternative GLUT implementation, e.g. Nate Robins' GLUT for Win32. Similarly, it should be possible to cross-compile the application on a non-Windows machine, compile the application to target a non-Windows machine, or build with tools other than MinGW and MSVC. However, some changes to the Makefile will likely be needed.

Building with MinGW

Before you start, changes to the Makefile may be needed. Firstly, the "INCLUDE_DIRS" and "LIB_DIRS" may need to be updated if your GLUT header files and import libraries are in a different location. Secondly, the "LDFLAGS" flags may need to be changed if you're not using freeglut. For example, if you're using GLUT for Win32, change "-lfreeglut" to "-lglut32".

To build the application on a Windows machine, open a command prompt, change to the directory containing the Makefile, and type "mingw32-make". The application should be compiled, linked, and output as "bin/HelloGLUT.exe". The appropriate GLUT DLL will either need to be in the same directory as the executable, or will need to be in a directory referenced in your "%PATH%" environment variable.

Building with MSVC

Before you start, changes to the project may be needed. Firstly, the "Include Directories" and "Library Directories" settings under "VC++ Directories", and the "Environment" setting under "Debugging" may need to be updated if your GLUT header files, import libraries, and DLLs are in a different location. Secondly, the "Additional Dependencies" under "Linker" -> "Input" may need to be changed if you're not using freeglut. For example, if you're using GLUT for Win32, change "freeglut.lib" to "glut32.lib".

To build the application in Visual Studio, select the configuration and platform from the drop-down menu, and use "Build Solution" from the "Build" menu.

The solution was created in Visual Studio 2017, but it should open in any version of Visual Studio from 2010 SP1 onwards.

Note: The project has precompiled headers disabled. This was done to ensure the project can be built with both MinGW and MSVC. There is no reason why you can't use precompiled headers with freeglut in MSVC.

Terms of Use

Refer to "License.txt" for terms of use.

Problems?

If you have any problems or questions, please ensure you have read this readme file and the Using freeglut or GLUT with MinGW article. If you are still having trouble, you can get in contact.

Changelog

  1. 2016-08-28: Version 1.0
  • Initial release.

Transmission Zero 2016-08-28

hello-glut's People

Contributors

martinpayne avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.