News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Hello, hi... and... first noob problem... :/

Started by Kernel, March 22, 2007, 12:57:38 AM

Previous topic - Next topic

Kernel

First of all hi !!!  :wink
Some days ago I began digging through some MASM-Sources of NeHe's tuts and
didn't have any serious problems, yet.
Some mins ago I happily stumbled over ur OpenGL-Forum and its Examples archive,
since I really wanna get into this stuff.
Well, I was really glad to see something like this,
because the MASM-Sources of NeHe's tuts don't reach the end (nor even the half of it),
...and I never seriously got into C++ or its conversion to MASM... :/
So at this point: YAY !!!!!  :U :U :U
I hope I can share some interesting knowledge with you guys in the future.

I already thought that I'd finished my first working demo (and it worked fine),
but than I noticed problems with ATI-Cards (I've got Nvidia):
I had usual WINDOW-Buttons and usual WINDOW-Editboxes in the OpenGL-Window,
which were somehow hidden by the OpenGL-Rendering on (some) ATI-Cards.
So I recoded the button stuff. I simulated the buttons and edit boxes with homemade BMPs,
and it works fine now "even" on the ATI-Cards.

Now my first question:
What way would you recommend for simulating the edit-boxes in the OpenGL-Window
(For example which kinda key-hooking/retrieving keyboard-input and showing it
centered in a simulated edit-box)?
I already got a working text-printing-routine with ogl,
but maybe you know some tricks to make the text-entering for the editbox look
like a real window editbox (with blinking cursor) ???

Thanks... :)

hitchhikr

Rendering windows controls directly on top of an openg window isn't a good idea, if you want to do that you'd better code them yourself using directinput (the framework handles di). When i'll have more time i've planned to add an example about using that library: http://www.cs.unc.edu/~rademach/glui/

Kernel

Quote from: hitchhikr on April 09, 2007, 10:39:09 PMWhen i'll have more time i've planned to add an example about using that library: http://www.cs.unc.edu/~rademach/glui/
:eek... uhhhh, this looks damn nice and useful !!!
That would be really nice, if u could find time for it...  :U

Meanwhile I managed to code it myself, but it wasn't really satisfying,
because I had to use VirtualKey-Codes. Works fine for a-z  A-Z  0-9,
but that way there won't be a smart solution for the special keys like } { ä ö ~ or whatever:

; Following I did use for my simulation of two window editboxes:
; In the first is to be entered a name - the second one shows the hash value
.IF keyTimer == 0
mov eax, wParam
mov keys[eax], 1   
.IF al == 20h || (al >= 30h && al <= 39h) || (al >= 41h && al <= 5Ah) || ((!keys[VK_SHIFT]) && (al >= 0BBh && al <= 0BFh))
lea edx, tbxName
add edx, NameChrPos
.IF !keys[VK_SHIFT] && al >= 41h && al <= 5Ah
add al, 20h
.ELSEIF keys[VK_SHIFT] && al >=31h && al <= 39h
sub al, 10h
.ELSEIF !keys[VK_SHIFT] && al >=0BBh && al <= 0BFh
sub al, 90h
.ENDIF
.IF NameChrPos < 30
mov [edx], ax
add NameChrPos, 1
invoke RtlZeroMemory,addr tbxHash,tbxHash
invoke CalculateHash
invoke szCatStr, addr tbxName, addr Cursor
invoke CenterString
.ENDIF
.ELSEIF ax == [VK_BACK] && NameChrPos > 0
lea edx, tbxName
sub NameChrPos, 1
add edx, NameChrPos
xor al,al
mov [edx], al
invoke RtlZeroMemory,addr tbxHash,tbxHash
.IF NameChrPos > 0
invoke CalculateHash
.ENDIF
invoke szCatStr, addr tbxName, addr Cursor
invoke CenterString
.ENDIF
.ELSE
add keyTimer,1
.IF keyTimer == keyDelay
mov keyTimer, 0
.ENDIF
.ENDIF


Greets

Kernel

Regarding GLUI...
Hm, yeah, I'm a looser in converting from C++  :'(
But I'll also look into it, try something and post it, if I'll succeed...  :8)

Cheers