flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > fasm example mistake

Author
Thread Post new topic Reply to topic
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
While browsing through the fasm examples folder i came across a mistake.
This pertains to the opengl example.
It is within the WM_CREATE message handler in the window procedure.
Code:
mov [pfd.dwLayerMask],PFD_MAIN_PLANE
    

This parameter is assigned to the wrong field.
It really should be this:
Code:
mov [pfd.iLayerType],PFD_MAIN_PLANE
    

This field is no longer used, only earlier implementations of opengl used it.
Anyway, here's a snippet from msdn regarding the acceptable parameters.
Code:
BYTE iLayerType 

Specifies one of the following layer type values: 
   PFD_MAIN_PLANE
   PFD_OVERLAY_PLANE
   PFD_UNDERLAY_PLANE 
    

If anyone can have this corrected, that would be nice.
As of now i am writing my own opengl framework for fasm.
Being the hardened C/C++ graphics coder that i am, the opengl part will be easy, but learning the asm part is going to be the biggest challenge.
Who knows, maybe if my opengl framework is nice enough it will one day make it into the examples section.
Ok, thanks for your time.

PS: Thanks to all the guru's here who have helped with my noobish posts.
Post 28 Aug 2008, 08:01
View user's profile Send private message Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
Hi Tomasz, i found another bug in the opengl example.
I had found this a while ago and fixed it in my sources,
but until today i forgot to mention anything about it...

In OPENGL32.ASM
Code:
import opengl,\
...
wglUseFontBitmapsA,'wglUseFontBitmapsA',\
wglUseFontOutlinesA,'wglUseFontOutlinesA',\
wglUseFontBitmapsW,'wglUseFontBitmapsW',\
wglUseFontOutlinesW,'wglUseFontOutlinesW',\
wglUseFontBitmaps,'wglUseFontBitmaps',\
wglUseFontOutlines,'wglUseFontOutlines',\
...
    


Do you see it?

I fix it like this...
Code:
import opengl,\
...
wglUseFontBitmapsA,'wglUseFontBitmapsA',\
wglUseFontOutlinesA,'wglUseFontOutlinesA',\
wglUseFontBitmapsW,'wglUseFontBitmapsW',\
wglUseFontOutlinesW,'wglUseFontOutlinesW',\
...

api wglUseFontBitmaps,\
    wglUseFontOutlines
    

The point being is that wglUseFontBitmaps and wglUseFontOutlines do not exist in opengl32.dll, only the A-W postfix variations do.

_________________
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 11 Apr 2009, 14:22
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.