flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
DimonSoft 02 Feb 2018, 22:48
ProMiNick wrote: I succed to Direct3DCreate9, succed to IDirect3D9.GetAdapterDisplayMode, and fault to IDirect3D9.CreateDevice. Your program fails to CreateWindowEx with GetLastError = ERROR_CANNOT_FIND_WND_CLASS. You have an error in your WNDCLASSEX initialization: you specify szAppName as window class name; should be szClassName. So, when Direct3D comes in play and tries to initialize on your window, it fails ’cause there’s no window to use. Note also that there’s plenty of other mistakes and smells in your code. For example, this line: Code: comcall [device],IDirect3DDevice9,Clear,0,NULL,D3DCLEAR_TARGET or D3DCLEAR_ZBUFFER,$808080,flt_1,0 will use address of flt_1 dword instead of actual value of 1.0. And it might not even be a valid float. Just replace it with 1.0. Another mistake is that you use BLACK_PEN in your WNDCLASSEX initialization. This constant is not intended to be used here: if you read MSDN carefully, you’ll find out that you should use COLOR_* constant plus 1 here. BLACK_PEN equals 7 equals COLOR_WINDOWFRAME+1 and that is how Windows sees your WNDCLASSEX. Besides, you’re going to redraw the whole client area anyway, so I’d suggest using 0 to avoid automatic background erasing. |
|||
![]() |
|
revolution 03 Feb 2018, 04:19
DimonSoft wrote: Your program fails to CreateWindowEx with GetLastError = ERROR_CANNOT_FIND_WND_CLASS. There are many places in that code where the return codes are ignored, so there are many places where this code can fail. And thus many opportunities to have hard to debug problems that seem to defy logic. |
|||
![]() |
|
ProMiNick 03 Feb 2018, 20:23
Thanks for help.
Later I will create examples of using Direct3D antology (from DX5 to DX11, I got SDKs of theese) (maybe & use of DX12) and I will share it with community in my pack fasm&fasmgAllinOne. Structuring & naming in SDKs I dislike, so I create my own: common incs for equates and structures that stay unchanged from version to version, all the rest maybe in single inc for each version, or maybe splited to equates & structs. My goal for future is carcas for 3D app, with selecting bitness (x86/x64) and engine (pure GDI, OpenGL, DX & version of DX) and examples of same things realized in different engines. And one more question: thread switching is slow? is it more effective realize in main thread thread-like-management: split code parts in minimal logic complete parts and query them? |
|||
![]() |
|
DimonSoft 05 Feb 2018, 09:24
ProMiNick wrote: And one more question: thread switching is slow? is it more effective realize in main thread thread-like-management: split code parts in minimal logic complete parts and query them? Thread switching might be slow but it is out of your control anyway. Multithreading is generally a bad idea when it comes to UI drawing since a lot of poorly documented dark corners of Windows history come into play. That’s why it is generally considered to be a good idea to have a single UI thread in your application, although you can have multiple helper threads which interact with the UI thread. You’d better describe what you mean by “split code in minimal logic complete parts and query them” in a more detailed manner. Otherwise, I don’t see how it differs from just splitting a program into procedures and calling them, which is not necessarily a thread-like management. Maybe you mean something like fibers but I think you’ll choose to avoid using them. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.