theCEED.com - Research your Interests!!
  • MEMBERSHIP PROFILE
  • bar
  • No member information.
  • login_button
  • sign_up_button
no_image

Easy to OpenGL

About the ceed

The purpose of this page is to inform the basics of OpenGL.
The reference books 'OpenGL Super Bible'
The information can be used as a non-profit purpose.
Recommend : 1 I Total List : 11 I 2015-07-08
favorite
Chapter. 1-2 ) Setting up Visual Studio 2015.07.09 14:52:04
Nickname : 81. theceed Recommend : 0 View : 549 btn_recommend.png declaration

Please enter reasons of report.

declaration



Today topic is 'Setting up Visual Studio'.

The purpose of this page is set up Visual Studio and show the simple graphic image.

 

1. What is OpenGL?

  OpenGL is this 

 

2. Programming Environment

  OS : Windows 7

  Program : Microsoft Visual studio 2010

 

3. Today Goal

  View simple graphic image.

 

3-1. Copying OpenGL Files <Visual Studio 2010)

  glut.h : C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\gl

  glut32.dll : C:\Wondows\System32

  glut32.lib : C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib

  File Download is Here

 

3-2. Setting for OpenGL Library

  -> Select Mfcgl Project : File > Open > Project/Solution

 

3-3. Select of Project Properties

  -> Mfcgl right click > Properties click

 

3-4. Configuration Properties > Linker > Input click

  > Additional Dependencies : opengl32.lib, glut32.lib, glu32.lib < typing

 

3-5. Mouse Event

  CMfcglView click > OnLButtonDown(...) Double click > 

  OnLButtonDown() - Obtain the x -and y-coordinate of the cursor.

 

  type text )

CMfcglDoc* pDoc = GetDocument();

GLfloat x, y;

 

x = point.x/width*(gl_right-gl_left)+gl_left;

y = (height-point.y)/height*(gl_top-gl_bottom)*gl_bottom;

 

CView::OnLButtonDown(nFlags, point);

 

If don't have 'OnLButtonDown' class, go to make

 

3-6. Basic color setting

CMfcglView click > GLRenderRC double click > Add the code for drawing

 

  type text )

// Black background

glClearColor(0.0f, 0.0f, 0.0f, 1.0f);

 

// Set drawing color to yellow

glColor(0.94f, 0.77f, 0.80f);

 

3-7. Size setting of Execution window

CMfcglView click > GLResize double click > Add the code for drawing

 

3-8. Code this

 

3-9. Rendering tasks are implemented on Windows

CMfcglView click > GLRenderScene double click > Add the code for drawing

 

type text )

CMfcglDoc* pDoc = GetDocument();

glClear(GL_COLOR_BUFFER_BIT);

 

glutSolidSphere(50, 30, 30);

 

3-10. Compile and Execute

 

Keywords ) Visual Studio, Visual Studio 2010, VS2010, OpenGL, Graphic, Graphic Library, OpenSource, Source, setting, image, image processing


 

list
Comments

name

write a comment
TOTAL  0 Comments
* No comments. Please write comments