flat assembler
Message board for the users of flat assembler.

Index > Windows > opengl first person camera

Goto page Previous  1, 2, 3, 4
Author
Thread Post new topic Reply to topic
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 20 Jul 2011, 07:36
I uploaded a new version today.
No longer do we collect input from message queue.
We now get input on each pass of the main loop.
This helps to prevent latency on slow machines.
Tested the input response on fps ranges 1~120.

@edfed:
Although possible, this would not be a good place to start.
For space-flyer i would use vector camera with sphere-skybox.
You can find quaternion demo at NeHe OpenGL Tutorials site.
That would be a better place to start for such a project.

_________________
Coding a 3D game engine with fasm is like trying to eat an elephant,
you just have to keep focused and take it one 'byte' at a time.
Post 20 Jul 2011, 07:36
View user's profile Send private message Reply with quote
Netherus



Joined: 31 May 2012
Posts: 1
Location: Troy, Michigan
Netherus 31 May 2012, 21:26
This is really nice! I am really interested in learning this. I have some OpenGL GLUT tutorials on the Pelles C site www.smorgasbordet.com. I am under Source Code -> Windows Samples -> OpenGL Graphics -> Christopher Hill Tutorials. I have no clue about assembly. Trying to figure out where to start. I think I am in the right place though.
Post 31 May 2012, 21:26
View user's profile Send private message Reply with quote
bzdashek



Joined: 15 Feb 2012
Posts: 147
Location: Tolstokvashino, Russia
bzdashek 01 Jun 2012, 09:42
I'd suggest to start with opengl example in fasm distribution, it outputs simple graphics. (FASM\EXAMPLES\OPENGL)
Post 01 Jun 2012, 09:42
View user's profile Send private message Reply with quote
Fred



Joined: 22 Oct 2010
Posts: 39
Fred 17 Oct 2012, 21:21
I'm currently writing a nes emulator in fasm and i'm not certain how to integrate what i have with windows code... hehe. I guess i'll look through this cool example and probably ask questions about it later. Razz

For now though, I'll just share one way of using openGL functions that aren't part of the opengl32.inc thing.

Code:
glGenBuffers dq ?


invoke wglGetProcAddress,"glGenBuffers"
mov [glGenBuffers],rax    

Replace dq and rax with dd and eax if you're doing 32 bit stuff. If it fails it should return null, so you could probably check for that if you want. Constants like GL_ARRAY_BUFFER can be found here for example.
Post 17 Oct 2012, 21:21
View user's profile Send private message Reply with quote
Fred



Joined: 22 Oct 2010
Posts: 39
Fred 19 Oct 2012, 23:10
So... hm. For now, I just want a smaller window, but I think i can do that. But basically I set up openGL stuff somewhere near the start of the code, and then run my code after that (near the .fontloop)... not sure what the .waitmessage is, maybe the "don't hog cpu" thing mentioned? Then I call .update when i want to draw something.

Is that the layman explanation somewhat correct? Razz


Edit: looks like the peekmessage was all i needed. After that, I placed the emulation code below that loop, some malloc and openGL stuff in .wmcreate and then invalidateRect and swapBuffers and such in .wmpaint.
Post 19 Oct 2012, 23:10
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, 4

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.