News:

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

Main Menu

Direct2d breakout

Started by BugCatcher, May 18, 2018, 02:38:10 AM

Previous topic - Next topic

BugCatcher

Decided to have some fun with direct2d. Ive started a 2d game engine and so far Ive got some objects and a menue. Pressing the esc key toggles the menue in and out. I'd be curious if it works on windows xp as I don't have that os anymore.

My ide is radAsm 3.0.0.c and artwork with inkscape. Os is windows 7

jj2007

On XP SP3, it says D2D1.dll not found:(

On Win7-64, it shows red squares but CPU usage goes over the top - did you forget the message pump?

avcaballero

In my W7 looks nice, but a bit huge and 25% CPU consuming. Did you use the Siekmanski d2d example?

BugCatcher

QuoteIn my W7 looks nice, but a bit huge and 25% CPU consuming. Did you use the Siekmanski d2d example?

No, its all my own stuff.

  .WHILE TRUE
invoke PeekMessage, ADDR msg, NULL, 0, 0, PM_REMOVE
.if (eax != 0)
;===================================
; Break if it was the quit messge
;===================================
mov eax, msg.message
.IF eax == WM_QUIT
;======================
; Break out
;======================
jmp shutdown
.endif

;===================================
; Translate and Dispatch the message
;===================================
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
.endif

invoke OnRender
invoke UpdateMenue
invoke UpdateObjects

.ENDW


I am flipping the screen 34 times a second. Painting the background and all objects.




jj2007

Windows doesn't work like that. Use GetMessage instead of PeekMessage...

Lonewolff

Quote from: jj2007 on May 18, 2018, 06:57:18 AM
Windows doesn't work like that. Use GetMessage instead of PeekMessage...

PeekMessage is normal for games. I'd definitely not recommend GetMessage, end user will get all sorts of weird stalls.

daydreamer

doesnt work on any of my computers :(
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

zedd151

win 10 home 64 bit, 70-80% cpu usage

looks nice so far and the menu works good

BugCatcher

Fixed the window size problem. Now buttons light up when mouse hovers over them.

BugCatcher

Buttons now click. Quit button works

zedd151

The new 3 state buttons look good, cpu usage is down to 45-46%  a step in the right direction.    :t

Windows 64  Home edition

LordAdef

Quote from: Ascended on May 18, 2018, 10:07:27 PM
Quote from: jj2007 on May 18, 2018, 06:57:18 AM
Windows doesn't work like that. Use GetMessage instead of PeekMessage...

PeekMessage is normal for games. I'd definitely not recommend GetMessage, end user will get all sorts of weird stalls.
+1 with Ascended: games usually use Peekmessage

LordAdef

Nice menu man!!!!!!! Classy stuff

win10. CPU at about 18%.

As soon as you sleep the game loop, CPU goes down to a nice %.


Siekmanski

OS win 8.1

When I click on start, the button flashes but nothing happens.
Or am I doing something wrong?
Creative coders use backward thinking techniques as a strategy.

BugCatcher

QuoteWhen I click on start, the button flashes but nothing happens.
Or am I doing something wrong?

Just the quit button works for now. I'm working on a high scores screen right now.