0

I have Created an OpenGL view on a Windows Form as on this and successfully embedded opengl into visual c++ windows form.Accordingly I have 2 files - rendering.h and opengl.h

Here's my original code....

Well then I extended my "OpenGL View on Windows Form" and combined it with NeHe's Tutorial "LESSON 27 - SHADOWS" and brought the code without errors. But still I have an obstacle!

Link error:

1> Generating Code...

1>PhotoRealisticRendering.obj : warning LNK4248: unresolved typeref token (0100002F) for 'GLUquadric'; image may not run

1>OpenGL.obj : warning LNK4248: unresolved typeref token (0100001B) for 'GLUquadric'; image may not run

Below are other 2 important files - shadow.h and 3Dobject.h

Venkat
  • 1
  • 2

2 Answers2

2

You're confusing GLUT with OpenGL. GLUT is a simplicistic application framework for creating a window and simple user interaction. You're not required to use GLUT at all.

You're using Windows Forms, which means, that is your framework. Using GLUT makes no sense then. You have to use the input event handling methods of Windows Forms. Here's an article on how to do it on MSDN: http://msdn.microsoft.com/en-us/library/ms171538(v=vs.110).aspx?cs-save-lang=1&cs-lang=cpp#code-snippet-1

datenwolf
  • 159,371
  • 13
  • 185
  • 298
  • Thankyou sir! Your answer is helpful...I'll try implementing input event handling methods of Windows Forms. – Venkat Feb 27 '14 at 11:00
  • Thankyou sir! keyboard event is working when i tried input event handling of Windows form! – Venkat Mar 04 '14 at 10:45
  • Sir! But Iam completely puzzled about how to represent arrow keys(UP ARROW, DOWN ARROW, RIGHT ARROW, LEFT ARROW). For other alphabetic keys i just used.... if(e->KeyChar=='D')... – Venkat Mar 04 '14 at 10:51
  • Keyboard event problem is finally solved! Thank you sir! – Venkat Mar 15 '14 at 13:10
0

EDIT: looking at the code you provided, it seems there's no relation between the keys array and your ProcessKeyboard callback. See for instance this answer.

(Original post snipped out, as not a good advice in this context, as stated by datenwolf)

-- Providing an excerpt of your source code always help to clarify/answer questions

Community
  • 1
  • 1
  • GLUT and other frameworks (like Windows Forms) don't mix. You can't use GLUT from within another framework. Your "advice" only adds confusion. – datenwolf Feb 27 '14 at 10:41
  • Through it's a bit hard to determine which framework was actually used by the OP in the end, I completely agree with you. – TallFurryMan Feb 27 '14 at 10:57
  • He's using Windows Forms. Just look at the tutorial OP linked (Windows Forms in Managed C++) and OP is mentioning it explicitly. – datenwolf Feb 27 '14 at 18:42
  • Yes, but OP is probably also using glutSolidTeapot to generate a mesh to display. However, it's not possible to hook a keyboard func with glutKeyboardFunc if no window was created with glutCreateWindow, so as previously stated, I completely agree with you :) EDIT: posted the comment before I saw the edit, but my original comment makes sense. – TallFurryMan Feb 28 '14 at 09:49
  • keyboard event problem is finally solved . Thankyou sir! – Venkat Mar 15 '14 at 13:11