flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Macro three files

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1251
Roman
I want write more easy and faster code.
My problem I have three places in code blocks for each object.

1 block load 3d mesh
2 block generate mesh level positions
3 block draw mesh
If I write this hands its painful.
And I have 40 objects. For this reason code look agly and i must jump diferents places code. Its crazy me.

How I think.
Macro load Mesh create equ include block a and b
In other place this is equ include two files.
Some like macro collection includes names from macro load Mesh.
Mesh generate level positions and draw mesh file
Post 08 Aug 2022, 03:45
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 576
Location: Ukraine
Overclick
Use my .stream then. You can easily transfer the parts of code to any place you want.

The big update of multisection macro coming soon.
Post 08 Aug 2022, 09:23
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1251
Roman
Overclick wrote:
Use my .stream

Whear is you stream?
Post 08 Aug 2022, 09:46
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 576
Location: Ukraine
Overclick
Quote:

Whear is you stream?

multisection
Post 08 Aug 2022, 10:03
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1251
Roman
Please give link site.
Post 08 Aug 2022, 11:22
View user's profile Send private message Reply with quote
donn



Joined: 05 Mar 2010
Posts: 230
donn
Yeah, definitely, if you parameterize the three sections, you can make them generic.

I'm not great at macros, more familiar with building functions, but if you break down what the parameters to each section are, maybe someone can help with how to turn that into a macro.

For example:
1 block load 3d mesh
- What are inputs? Outputs?
- OBJ format?
- I guess input might be filename
- then you open file in macro, loop through each line
- build list of faces, vertices
- output is structure that has these lists
2 block generate mesh level positions
- What does this mean? are you building a transform matrix that transforms into world space?
- input is maybe the struct from step 1, plus world position info, output is same struct with the transform matrix
3 block draw mesh
- input is struct
- draw with api using index buffer, vertex buffer
- end draw call recording if thats how api works


Graphics is tough and tedious, and I'm not great at macros, but think these are the pieces. Also, curious what platforms your're using and libraries to display,, i.e. DX12 or Vulkan
Post 09 Aug 2022, 01:21
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1251
Roman
Only Windows 10 Directx11, Directx 12
Post 09 Aug 2022, 10:30
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.