News:

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

Examples archives history

Started by hitchhikr, August 14, 2005, 02:27:28 PM

Previous topic - Next topic

Mark Jones

As fast as you're working Hitchhikr, we almost need an RSS feed! :bg
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

hitchhikr

Added Skybox_And_Camera.

(Only Examples.zip updated).

hitchhikr

I improved/cleaned up some examples.zip archive files.

Mark Jones

Oooh! What about support for GMAX/3dsmax and Rhino3d mesh data? :toothy

Was a sample Lightwave .obj file supposed to be included in the latest release?
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Siekmanski

Cool stuff Hitchhikr !!!

I'll study OpenGL now. ( still coding in DirectX9 )
Thanks for all the nice examples.   :U

Mark Jones

I'm attempting to make some custom mouse pointer code for the OGL window, based on the DirectInput example. I tested the original example with MemProof and it reports that CreateBrushIndirect and CreateFont are not being freed. I am unsure how important this is, but adding the following to Fonts.asm seems to fix the font handle:

Create_Font_Bitmap   proc   Font_Name:dword, Font_Size:dword, Font_Weight:dword
    local    _Font_List:dword, hFont:dword

    ; Create the fonts
    invoke glGenLists,256
    mov _Font_List,eax
    .if eax != 0
        mov eax, Font_Size
        neg eax
        invoke CreateFont, eax, 0, 0, 0, Font_Weight, 0 , 0 , 0, ANSI_CHARSET, OUT_OUTLINE_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, FF_DONTCARE, Font_Name
        mov hFont,eax
        .if eax == 0
            invoke Destroy_Font, _Font_List
            xor eax,eax
            ret
        .endif
        invoke SelectObject, g_window.hDC, eax
        invoke wglUseFontBitmaps, g_window.hDC, 0, 255, _Font_List
        mov eax,_Font_List
    .endif
    invoke DeleteObject,hFont
    ret
Create_Font_Bitmap   endp


And the Framework.asm - CreateBrushIndirect:


Main         proc
...
    local   hBrush:dword
...
    invoke CreateBrushIndirect, addr _SubEditBrush
    mov hBrush,eax
    mov [ebx + WNDCLASSEX.hbrBackground],eax
...
    invoke Deinitialize
    invoke ChangeDisplaySettings, NULL, 0
    .if g_window.hWnd != 0
        .if g_window.hDC != 0
            invoke wglMakeCurrent, g_window.hDC, 0
            .if g_window.hRC != 0
                 invoke wglDeleteContext, g_window.hRC
            .endif
            invoke ReleaseDC, g_window.hWnd, g_window.hDC
        .endif
        invoke DeleteObject,hBrush
        invoke DestroyWindow, g_window.hWnd
    .endif
    invoke ShowCursor, TRUE
    invoke UnregisterClass, addr g_ClassName, g_window.init.application.hInstance
    invoke Flush_Event
FallBack:
    .if g_Error_Message != NULL
         invoke MessageBox, HWND_DESKTOP, g_Error_Message, addr g_WindowName, MB_ICONERROR or MB_OK
    .endif
    ret
Main         endp
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

hitchhikr

I fixed this already and a couple of other ones.
I'm working on an example right now so except an update soon with these two ones corrected.

hitchhikr

- Fixed a bug in the coordinates of the 2d bitmap fonts.
- Fixed a bug in DInput_Clamp_Mouse.
- Fixed some memory leaks.
- Added Sprites_Collisions.

Both archives updated.

hitchhikr

- Fixed an issue with 32 bits pictures in Targa.asm.
- Renamed Display_2D_Bitmap into Display_TARGA.
- Added Display_BMP.

(Both archives updated).

Mark Jones

Hi Hitchikr. :) Couple issues, XP SP2
* display_bitmap.exe - black window, closes with asterisk sound
* sprites_collisions.exe - ditto
* vertex_array_and_wavefront_obj.exe - page fault at 00404386h

This is with EVE running, this shouldn't be a problem but who knows. :) I'll try without eve running later.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

hitchhikr

I updated Vertex_Array_And_WaveFront_Obj in the examples.zip.

Make sure that the archives layout is as follow:

OglArchive
   |
   +- Examples
   |
   +- Media

The Media directory is located outside the examples one.
Also make sure you have the latest versions of both archives.

I don't know why it produces beeps, maybe there's a problem with an alert messagebox which is not displayed or something.

I'm using XP sp1.

Siekmanski

Display_BMP works fine on my computer "XP sp2"

Sprites_Collisions didn't work

Couldn't find sprite1.tga and sprite2.tga
I did make some sprites on my own but they couldn't be loaded into the program.

Vertex_Array_And_WaveFront_Obj

Can you insert the fish2.obj  and the sprites in the next upload ??

All other examples are running O.K.

hitchhikr

These files are actually in the media.zip archive, there's 15 files in it, always make sure you have the latest one.

Beware of the browser's cache.

Siekmanski

Thank you Hitchhikr.

O.K. I did download the "media.zip" archive directly from your page
with all the files in it.   :P

The "Example archives content and urls" only have these two links:

http://perso.wanadoo.fr/franck.charlet/Common.zip
http://perso.wanadoo.fr/franck.charlet/Examples.zip

missing the media.zip

Now all examples work fine except "Vertex_Array_And_WaveFront_Obj.exe"

It assembles and links OK but when I run the file it crashes....   :'(

hitchhikr

My bad, i forgot to modify the link :green
The only required ones are Examples.zip & Media.zip

Where'n'when does it crash ?