|
|||||||
| Forum Home | Register | Members List | Mark Forums Read |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | ||||||||
|
Member
Location: N. America |
You might be wondering, whats with the title! Well, its been two days and this bug is killing me
![]() I am trying to learn openGL and am trying to learn and use native windows code rather than GLUT handling everything for me. Thus, I thought i'll write a general window wrapper around the openGL stuff, without really mixing the two functionalities. Thus, I made two modules: -myWin -Application For beginning, I needed a window in which I could render my openGL stuff. Thus, I tried learning setting up my window in the myWin class. I followed some tutorials online, and have been able to get a basic framework done. "But", there are some bugs which I still dont understand in their entirety and that is what is messing me up. Following are the errors to which I could not even understand the solutions posted online (found em via searching on the web): (If you open the attached files, it would really become very clear to you. Anyways, here are my problems ![]() 1. Code:
LRESULT myWin::WndMsgProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) Code:
wc.lpfnWndProc = (WNDPROC)WndMsgProc; Code:
error C2440: 'type cast' : cannot convert from 'overloaded-function' to 'WNDPROC' None of the functions with this name in scope match the target type 2. There are more issues, like toggling between unicode and multiset character base, but i want to solve one problem at a time here. |
||||||||
|
|
|
|
|
#2 | ||||||||
|
Administrator
Location: UK |
You can't assign non-static class functions to function pointers due to way classes work (i.e all class non-static functions have a this pointer variable).
The Win32 API is a C library, not a C++ one which can make it very hard to use.
__________________
Steven Yau [Alix Games Blog] [Portfolio] [How I broke into the Games Industry] [Why I left my Games Job] [How to be a Games Tester] [Getting back into the Game] |
||||||||
|
|
|
|
|
#3 | ||||||||
|
Member
Location: N. America |
So, is the best way to go about things..
(PS: Please see the attached files) |
||||||||
|
|
|
|
|
#4 | ||||||||
|
Administrator
Location: UK |
Making all the member variables static? Differently not.
__________________
Steven Yau [Alix Games Blog] [Portfolio] [How I broke into the Games Industry] [Why I left my Games Job] [How to be a Games Tester] [Getting back into the Game] |
||||||||
|
|
|
|
|
#5 | ||||||||
|
Member
Location: N. America |
Soo..then how should i do it??? Some leads ??
|
||||||||
|
|
|
|
|
#6 | ||||||||
|
Administrator
Location: UK |
Google: lpfnWndProc
Result: http://www.gamedev.net/reference/art...rticle1810.asp
__________________
Steven Yau [Alix Games Blog] [Portfolio] [How I broke into the Games Industry] [Why I left my Games Job] [How to be a Games Tester] [Getting back into the Game] |
||||||||
|
|
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Powered by vBulletin® Version 3.6.9
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
All times are GMT -8. The time now is 04:42 PM.






















Linear Mode

