What's new

OpenGL

Programulator

New member
I am programming using GLUT open gl library. When I call GlutMainLoop(); is there a way to call other functions after it? or for that matter have the emulation loop processing and GlutMainLoop() at the same time? I ask this because I want to init my emu I want to display the window, and then begin cpu execution, and it hasn't been working. I mean, I did figure out a way to do it, but when i click on the window while graphics are drawing, it hangs. Suggestions?
 

NoeOM

Mankind Member
Callbacks

You have to write event processing functions. I they are called callbacks in GLUT. Once written, you have to set them using the glut*callback() functions, such as glutMouseCallback() for the mouse, glutKeyboardCallback() for the keyboard and so.

Anyway, GLUT is a well known library and there are lots of samples an tutorials out there. Google it!
 

Exophase

Emulator Developer
To do things in the background you should use the idle callback, however, you have to make it capable of working in steps at a time (for instance, have it emulate all of the instructions until vsync is hit)
 
OP
P

Programulator

New member
Alright, thanks for the links. I figured out what I needed to. Right now I am messing with opengl/sdl programming. Now my next question is when I render graphics, say from chip 8 with resolution 64x32, is there a way to stretch the screen so the graphics are not so tiny, or do I have to do that on my own? I really couldn't find a straight answer to this on google. Gosh, I really think allegro has spoiled me :unsure:
 

Garstyciuks

New member
My emulator does it itself. It can draw 2 times, 4 times and 8 times bigger pixels. I do this by multiplying the coordinates of a pixel. You can check the source code. It uses OpenGL and MFC. There's a link in my signature.
 

Cyberman

Moderator
Moderator
Programulator said:
Alright, thanks for the links. I figured out what I needed to. Right now I am messing with opengl/sdl programming. Now my next question is when I render graphics, say from chip 8 with resolution 64x32, is there a way to stretch the screen so the graphics are not so tiny, or do I have to do that on my own? I really couldn't find a straight answer to this on google. Gosh, I really think allegro has spoiled me :unsure:
Spoiled programmer!
Try using a texture and changing it with every update. After this you can stretch the texture pretty much anyway you want even just a regular 2d surface :)
Now if you wanted to get fancy you could update it onto the surface of a cube or a 3d object. The skys the limit really.

Cyb
 

Top