Jump to content
  • Advertisement
Sign in to follow this  
hannibar

OpenGL openGL non-game interface

This topic is 5469 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm quite a newbie in programming, and I would like to start on a rather big project to devellop my skills. So I planning to program my own GUI (not a game interface, just an interface like the windows interface for example). I know it is possible because I've seen apps who do it that way (blender3d for example). I just don't know how. A few questions : 1) Is it possible to create an openGL window, and say : draw a line from this pixel to this pixel. Or draw a dot on this pixel. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
You can use gluOrtho(screenWidth, screenHeight); Where screenWidth/Height are in pixels. You would then use things such as glVertex2i(100, 100); instead of 3f.

Share this post


Link to post
Share on other sites
Quote:
Yes it is. You'll want to look into ortho projection (glOrtho).

What are the arguments I have to give then?
Is it glOrtho(0.0, 640.0, 0.0, 480, 0.0, 1.0) ?

What functions do I have to use then for the drawing?
glVertex3f ?

Quote:
You can use gluOrtho(screenWidth, screenHeight); Where screenWidth/Height are in pixels. You would then use things such as glVertex2i(100, 100); instead of 3f.

I have tried this, but it looks like this isn't a function from the standard libraries.

Although I included these libraries :

#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glaux.h>

MSVC gives this error :

error C2065: 'gluOrtho' : undeclared identifier

Share this post


Link to post
Share on other sites
Quote:
Original post by hannibar
I'm quite a newbie in programming, and I would like to start on a rather big project to devellop my skills.


That's not really the best way to do it. Why not start with OpenGL by writing a program that draws a box using lines? That's what I did.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!