[Newbie] How does OGL fit to C++ 6.0?
I''ve been reading the NeHe Tutorials, and I understand drawing polygons, color, rotating, solid objects.
I don''t really care if I go any further, I mean, I want to, but thats not my concern.
In the NeHe Tutorials, all the program is, is a graphics window, then you press ESC and exit.
I''ve been programming for about 4 years, and I''ve been learning C++ for about 3-4 months now, and I know enough.
I already have a couple RPG-Strategy-Based Games in the DOS All-Text Window (Console Project).
What I want to learn is how I can put my programming INTO the art. Can I create buttons and the person can click on them? Or at least take keyboard input to continue through the program?
I know programming, and I understand the graphics, but I don''t know how to mix them both.
===============
Xavior,
Mind and Fire
===============Xavior, Mind and Fire
I''m not sure exactly what you want but am I right in assuming that you would like to have the 3D object respond to keyboard events, well NeHe has a tutorial on that. If you would like to be able to click on the object then there no simple answer as the object are saved in 3D not 2D, that said check out the forums on opengl.org, that question seem to always come up.
Hm, I guess my post was a bit confusing. This is what I want.
The background will be a picture, but on the left hand side, I wanta row of buttons. On the right hand side will be text displayed according to what button you pressed.
If that helps anyone figure out my problem, good.
If you want to see what program I''m doing this for, e-mail me and I''ll give you a link to the download site.
===============
Xavior,
Mind and Fire
The background will be a picture, but on the left hand side, I wanta row of buttons. On the right hand side will be text displayed according to what button you pressed.
If that helps anyone figure out my problem, good.
If you want to see what program I''m doing this for, e-mail me and I''ll give you a link to the download site.
===============
Xavior,
Mind and Fire
===============Xavior, Mind and Fire
If you are planning to use FULLSCREEN mode you cannot use Windows interface (buttons, scrollbar, edit box,...).
You have to create your own controls.
For example if you need buttons you have to draw your buttons as bitmap on the screen.
Simply draw a textured quad in the right position. The texture is the button image or the entire row of buttons (like a Windows toolbar).
Then check if the mouse pointer is in the button-rectangle and if the mouse button is down.
Of course you have to draw your own pointer because in FULLSCREEN you should hide standard windows pointer (on certain systems you miss it in FULLSCREEN)( ShowCursor(FALSE) ).
Implement buttons is very easy but if you need more sofisticated controls (like edit box or menu) it can be more difficult.
You have to create your own controls.
For example if you need buttons you have to draw your buttons as bitmap on the screen.
Simply draw a textured quad in the right position. The texture is the button image or the entire row of buttons (like a Windows toolbar).
Then check if the mouse pointer is in the button-rectangle and if the mouse button is down.
Of course you have to draw your own pointer because in FULLSCREEN you should hide standard windows pointer (on certain systems you miss it in FULLSCREEN)( ShowCursor(FALSE) ).
Implement buttons is very easy but if you need more sofisticated controls (like edit box or menu) it can be more difficult.
IpSeDiXiT
Okay, I''m going to try Rectangular Buttons. I''ll see if I can get the mouse to appear.
Can anyone send me a link/code to check if the mouse is down in the button?
So, I can''t get text to appear in FULLSCREEN mode? Will it be able to appear not in FULLSCREEN mode?
===============
Xavior,
Mind and Fire
Can anyone send me a link/code to check if the mouse is down in the button?
So, I can''t get text to appear in FULLSCREEN mode? Will it be able to appear not in FULLSCREEN mode?
===============
Xavior,
Mind and Fire
===============Xavior, Mind and Fire
RECT rect; // this is the rectangle of your button on the screenPOINT mouse; // this is the current mouse positionif ((mouse.x >= rect.left) && (mouse.x <= rect.right) && (mouse.y >= rect.top) && (mouse.y <= rect.bottom)){ // Yahoo! The mouse is hovering above our button.. if (bLeftButtDown) ...}
it seems to me you need to learn windows programming.. get a book!
tricks of the windows game programming gurus (Andre La''moth) and Programming Windows 95 (charles petzold?) are both good.
tricks of the windows game programming gurus (Andre La''moth) and Programming Windows 95 (charles petzold?) are both good.
(http://www.ironfroggy.com/)(http://www.ironfroggy.com/pinch)
One way to do the things you ask about is to use MFC in conjunction with OpenGL. There is a link to some excellent MFC/OGL tutorials from NeHe''s page. Some people really don''t like MFC and prefer to use win32API (like the windows code in NeHe''s tuts) but if you''re into Object Orientation then you should find it OK. MSDN has good (but hard to navigate) documentation on the basics of MFC.
Another way (so I hear) is GLut, which can do buttons/menus and is platform independant.
Another way (so I hear) is GLut, which can do buttons/menus and is platform independant.
[size="1"]
actually, GLUT has no buttons or other controls at all, only very simple popup menu''s, that''s because it''s meant to be simple and platform independant:
www.fatech.com/tech/opengl/glut/index.php3?1
now for the UI: i know there was an article about this at gamedev some time ago, it used direct input if i remember correctly, but maybe you can find some nice samples there
i think it was called ''Creating a GUI using C++ and DirectX'' or something, just do a search
www.fatech.com/tech/opengl/glut/index.php3?1
now for the UI: i know there was an article about this at gamedev some time ago, it used direct input if i remember correctly, but maybe you can find some nice samples there
i think it was called ''Creating a GUI using C++ and DirectX'' or something, just do a search
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement