OpenGL, freeGLut, and GLEW on Surface Pro - opengl

I am currently taking a college course in Computer Graphics and we are using Visual Studio 2012.
I am trying to get it set up to use freeGLUT and GLEW, but am currently not having any progress.
I have searched everywhere, but have not had any luck finding anything on using a Surface Pro to do this. My professor managed to get it to work on a desktop with Windows 8, but has not tried with a Surface Pro.
I currently do not have any other system to do this on or else I would use one, nor do I have the funds to purchase something else. The Surface Pro has been great for everything else so far, just not this.
UPDATE
I have had some better luck so far using GLEE and freeGLUT. I am now getting this error.
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\GL/gl.h(1157): error C2054: expected '(' to follow 'WINGDIAPI'
I included windows.h and now it is saying there are syntax errors in my gl.h
UPDATE 2
Program works now. the dll files are with the project files. I also had to reinstall Visual Studio 2012. Good news is IT WORKS! Thanks for those who showed interest and tried to help.

Like as always when it comes to OpenGL, Microsoft makes it not easy, because for some reason (we can only speculate about) they don't like OpenGL. Hence ever since Windows Vista they ship their products with no, or only limited OpenGL support.
The first step is, to go to Intel.com and download the latest OpenGL drivers for the GPU the Surface Pro uses.
This should give you proper OpenGL support, though the Intel drivers for Windows are only mediocre.

Related

Linking DirectX

I am working on a DirectX9 project, and it is time now to start doing sprites, and to do so, I need d3dx9.h included, so after a while of trying to get it linked properly, which itself was confusing because it found d3d9.h just fine and its in the same location as d3dx9, I assumed that I would just need to add it to additional libraries, and after a while it finally worked. However upon running the program I get an error, from d3dx9core.h:
C2061: syntax error: identifier 'TEXTMETRICA'
I cannot find any answers online, and cannot figure out what is causing this problem. The line of code is 330 of d3dx9core.h, STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *pTextMetrics) PURE; it comes with four errors, all pointing to this line. Any thoughts?
If you use the legacy DirectX SDK with VS 2015 or later, you need to make sure the DXSDK include/lib paths are after the standard Windows 8.1 SDK / Windows 10 SDK paths. This is because the legacy DirectX SDK has out-of-date copies of some Windows headers.
Details are covered at the bottom of Microsoft Docs.
DirectX 9 is very old, and really was only needed to target Windows XP. You should look at DirectX 11 instead, and in particular DirectX Tool Kit's SpriteBatch. See Living without D3DX.

Where to get an up-to-date OpenGL32.lib?

this one drives me crazy. I've been searching for two days but cant find any answer.
I want to develop some things with OpenGL 3 (or newer) with Visual Studio 2010 / C++.
The header and libraries provided by Microsoft are way too old to support OpenGL 3, so I'm trying to find newer versions. I easily found the header file in the OpenGL registry (http://www.opengl.org/registry/) but I cant find the OpenGL32.lib anywhere. How am I supposed to link a program without it?
There isn't a newer OpenGL library for windows, and there won't be. They decided to stop at OpenGL 1.1 and even call it a legacy graphics.
However, you can use load opengl function, and that is how people get access to the latest opengl features.
You can also use GLEW library to get access to the opengl functions.

OpenGL in WIndows7

I want to write code in OpenGL using Visual Studio 2010 . Now on opening opengl.org , I am redirected to http://user.xmission.com/~nate/glut.html ; which presumes I am using WindowsXP and Visual Studio 6 . The instructions in this page http://user.xmission.com/~nate/glut/README-win32.txt dates back to 2001 , and not in current context .
Long story short, is there any tutorial which will help me to program with OpenGL in Windows 7 using Visual Studio 2010 .
Thanks in advance for taking the time to answer my question . I am new to this , so please bear with me.
OpenGL development under Window-7 is the very same as it has been for Windows-NT 4, Windows 2k and Windows XP. All the tutorials remain valid.
You do not require a OpenGL SDK. Everything you need ships with your compiler. OpenGL is not a library, but an API implemented by the drivers. So make sure you download and install the most recent drivers directly from your GPU's vendor's homepage (don't use the drivers shipping with Windows, because those have only very limited support for OpenGL).
Since you surely want to use recent OpenGL functionality you should however get the GLEW library, which eases up the loading process for the so called "extensions" by several orders of magnitude; highly recommended. Then instead of the regular OpenGL header you include GL/glew.h and call glewInit() right after an OpenGL context has been made active.
Instead of the old, outdated, no longer maintained GLUT, you should use FreeGLUT or OpenGLUT; if using GLUT at all, because you'll hit its limitations very soon. I recommend using GLFW instead.
First of all, configure your project to link with opengl32.lib etc.:
OpenGL config in Visual Studio 2010.
Look at some NeHe tutorials http://nehe.gamedev.net/.
What about Visual Studio 2010 and Windows 7 - I don't think there is some significant differences in API with previous versions of Visual Studio and Windows (at least for simple examples).
Also look at: OpenGL API Documentation Overview

Setup VisualC++ to use OpenGL 4.1?

I'm trying to setup VC++ to compile code with OpenGL 4.1 functionality. I downloaded the 3 header files from from opengl.org; put them in the correct paths and include them - but keep getting errors like this:
error C3861: 'wglSwapIntervalEXT': identifier not found
I have the latest video drivers. OpenGL says the problem is MS includes only version 1.1 with their compiler when though the vendor/driver supports 4.1.
One of the big pains of using OpenGL on Windows is that the Windows SDK only ships with OpenGL 1.1. There's probably a really good technical (and non-political) reason for this, but the fact remains, if you want to do anything with OpenGL on Windows, you're on your own.
What you need then, is something to bring the Windows SDK up to current standards (OpenGL 4.1 as I write this.) When I was originally trying to solve this problem (around the time of OpenGL 3.0), I came across GLee http://elf-stone.com/glee.php which is a cool library which makes the full OpenGL spec available easily. I didn't like their license, so I decided to write my own extension loader.
I don't think anyone should ever have to do this again, so I've made mine public domain, do with it as you will. I'd like to hear if you use it in something, but that's not a requirement.
http://www.onemanmmo.com/index.php?cmd=newsitem&comment=news.1.28.0

Setting up OpenGL with C++ and Visual Studio 2008

Hey I was wondering if there are any good tutorial out there on how to set this up? I have seen the NeHe tutorials from gamedev.net but some of them seem to be out dated... any clues?
thanks
NeHe may be a little old, but it's certainly not outdated. Unlike DirectX, OpenGL gets updated very seldomly. The tutorials there are still perfectly good for modern OpenGL programming. The Visual C++ code for lesson 1 should work in pretty much any non-ancient version of Visual Studio, and the code for most of the samples is available in many, many languages and platforms.
Do you have Visual Studio 2008 Professional or one of the "Express" editions? The express editions require the Windows Platform SDK because they do not come with the OpenGL header files, etc.
Also, if you're going to use GLUT, you need to download that separately. If you need more information let us know!
This is a random site I found with Google explaining how to make it work with the Express edition.
http://thoughtsfrommylife.com/article-748-OpenGL_and_Visual_Studio_Express_2008
Edit: I forgot to mention the obvious counterpoint of all that -- If you have the full VS2008, OpenGL just works -- no setup needed. If you need GLUT, you still have to get it separately.
I think this is a good tutorial, step by step, very clear with the paths for the libraries:
http://ins.nafsadh.com/2009/09/07/opengl-and-glut-in-c-with-ms-visual-studio-2008-msvs9/
Also check my answer to a similar question.