News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

NeHe Tutorial in masm64

Started by Mikl__, August 06, 2020, 12:55:45 PM

Previous topic - Next topic

jj2007

#30 works like a charm and looks quite impressive, Mikl :thumbsup:

Mikl__

#136
I suffered for a long time with 30th lesson on my own until Timo helped to me . Many thanks to Timo!

Biterider

Very cool
The big effort seems to be worth it  :thumbsup:

Biterider

avcaballero


TouEnMasm

Fa is a musical note to play with CL

jj2007


Mikl__

Quote from: TouEnMasmVirus?!
Bonjour, TouEnMasm!
Là est ASM-source, si vous pensez que j'ai mis un virus dans le programme, essayez de créer le programme vous-même ...

six_L

Hi,Mikl__
the lesson30 is very very good. :thumbsup: :thumbsup: :thumbsup:
thanks you has done much effective work with opengl.  :eusa_boohoo: :eusa_boohoo: :eusa_boohoo:
Say you, Say me, Say the codes together for ever.

TouEnMasm

#143
Quote
Bonjour, TouEnMasm!
Là est ASM-source, si vous pensez que j'ai mis un virus dans le programme, essayez de créer le programme vous-même ...
be cool I don't think that.
Probable reason "WinMain   proc"    is not standard  and had no ret  , must be a question for AV

WinMain proc
local msg:MSG

xor ebx,ebx
        mov edi,offset szClassName
        mov esi,IMAGE_BASE
        mov ecx,offset FileName
invoke LoadCursorFromFile
        push rax ;hIconSm
push rdi ;lpszClassName
push rbx ;lpszMenuName
push COLOR_WINDOWTEXT+1;hbrBackground
push rax ;hCursor
push rax        ;hIcon
push rsi ;hInstance
push rbx        ;cbClsExtra & cbWndExtra
pushaddr WndProc;lpfnWndProc
mov rax,(CS_HREDRAW or CS_VREDRAW or CS_OWNDC)shl 32 \
or (sizeof WNDCLASSEX)
push rax ;cbSize & style
invoke RegisterClassEx,esp ;addr WNDCLASSEX

push rbx
push rsi ;rsi = 400000h
shl esi,9 ;rsi = CW_USEDEFAULT
push rbx
push rbx
push WINDOWHEIGHT
push WINDOWWIDTH
push rsi
push rsi
sub esp,20h
    invoke CreateWindowEx,0,edi,edi,WS_OVERLAPPEDWINDOW or \
WS_CLIPCHILDREN or WS_CLIPSIBLINGS or WS_VISIBLE
;öèêë ñîîáùåíèé
    lea edi,msg
@@: invoke GetMessage,edi,0,0,0
invoke DispatchMessage,edi
jmp @b
WinMain endp
Fa is a musical note to play with CL

Mikl__

Bonjour, TouEnMasm!
For the normal completion of the Windows program, it is enough to process the WM_DESTROY message
WndProc proc hWin:QWORD,uMsg:QWORD,wParam:QWORD,lParam:QWORD
        mov hWin,rcx

        cmp edx,WM_CREATE
je      wmCREATE
        cmp edx,WM_SIZE
je      wmSIZE
        cmp edx,WM_PAINT
je      wmPAINT
        cmp edx,WM_DESTROY
je      wmDESTROY     
        cmp edx,WM_KEYDOWN
je      wmKEYDOWN
        cmp edx,WM_TIMER
je      wmTIMER
leave
jmp NtdllDefWindowProc_
wmDESTROY::invoke wglMakeCurrent,0,0
invoke wglDeleteContext,hRC
invoke ReleaseDC,hWin,hDC
invoke KillTimer,hWin,10
invoke RtlExitUserProcess,NULL; <----

Mikl__

#145
Lesson #30: Collision Detection. Ultimate gloss

Now, when the program has started working, we will eliminate the discovered disadvantages

TouEnMasm

Fa is a musical note to play with CL

Mikl__

Hello, All!
Now I'm dealing with lesson #43 (FreeType fonts in OpenGL). Can anyone help create structures for the 64 bit masm?

  • FT_Face,
  • FT_Library,
  • FT_Bitmap,
  • FT_BitmapGlyph,
  • FT_Glyph

jj2007

From what I see in FreeType.h, Ft_Face is just a handle; same for FT_Library. But I'm not a C guy...

Mikl__

Thank you jj
How to translate this FT_shit into normal masm-structures with real4, real8, qword and dword? Moreover, take into account the specifics of masm64?
FT_Int  = signed int
FT_Long = signed long
FT_String*
FT_Bitmap_Size*
FT_CharMap*
FT_Pos = signed long
FT_Generic =
---------------------------------------
typedef struct  FT_BBox_
  {
    FT_Pos  xMin, yMin;
    FT_Pos  xMax, yMax;

  } FT_BBox;
---------------------------------------------------
FT_UShort = unsigned short
FT_Short  = signed short
-------------------------------------------------------
typedef struct  FT_Bitmap_
  {
    unsigned int    rows;
    unsigned int    width;
    int             pitch;
    unsigned char*  buffer;
    unsigned short  num_grays;
    unsigned char   pixel_mode;
    unsigned char   palette_mode;
    void*           palette;

  } FT_Bitmap;
----------------------------------------------------
typedef struct  FT_BitmapGlyphRec_
  {
    FT_GlyphRec  root;
    FT_Int       left;
    FT_Int       top;
    FT_Bitmap    bitmap;

  } FT_BitmapGlyphRec;
-------------------------------------------------------
typedef struct  FT_GlyphRec_
  {
    FT_Library             library;
    const FT_Glyph_Class*  clazz;
    FT_Glyph_Format        format;
    FT_Vector              advance;

  } FT_GlyphRec;
---------------------------------------------------
typedef struct FT_LibraryRec_   *FT_Library
-----------------------------------------------------
typedef struct  FT_Vector_
  {
    FT_Pos  x;
    FT_Pos  y;

  } FT_Vector
------------------------------------------------
typedef struct FT_FaceRec_*  FT_Face
{
    FT_Long           num_faces;
    FT_Long           face_index;

    FT_Long           face_flags;
    FT_Long           style_flags;

    FT_Long           num_glyphs;

    FT_String*        family_name;
    FT_String*        style_name;

    FT_Int            num_fixed_sizes;
    FT_Bitmap_Size*   available_sizes;

    FT_Int            num_charmaps;
    FT_CharMap*       charmaps;

    FT_Generic        generic;

    /*# The following member variables (down to `underline_thickness`) */
    /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size    */
    /*# for bitmap fonts.                                              */
    FT_BBox           bbox;

    FT_UShort         units_per_EM;
    FT_Short          ascender;
    FT_Short          descender;
    FT_Short          height;

    FT_Short          max_advance_width;
    FT_Short          max_advance_height;

    FT_Short          underline_position;
    FT_Short          underline_thickness;

    FT_GlyphSlot      glyph;
    FT_Size           size;
    FT_CharMap        charmap;

    /*@private begin */

    FT_Driver         driver;
    FT_Memory         memory;
    FT_Stream         stream;

    FT_ListRec        sizes_list;

    FT_Generic        autohint;   /* face-specific auto-hinter data */
    void*             extensions; /* unused                         */

    FT_Face_Internal  internal;

    /*@private end */

  } FT_FaceRec;