is Accessing memory adress possible in GM ?

H

Hossein

Guest
Hi all, I just trying use Bresenham Algorithm to Draw a line and then use line's to draw a shadow behind a shape, as you know that require accessing memory address, am I able to do it with GML or any Include File's (DLL, or stuff) ?
i will glad if person who have this experience share a link with clear describe for guid me, iam starter also tnx
 
D

dannyjenn

Guest
I am not familiar with the Bresenham Algorithm, but I just looked it up and I see no reason why it would require accessing any memory addresses. Could you explain what you're trying to do exactly? Maybe there's a workaround.

But to answer your question, no, GML does not allow you to directly access the RAM. But I don't know whether there are any DLLs that can do this.
 
H

Hossein

Guest
I am not familiar with the Bresenham Algorithm, but I just looked it up and I see no reason why it would require accessing any memory addresses. Could you explain what you're trying to do exactly? Maybe there's a workaround.

But to answer your question, no, GML does not allow you to directly access the RAM. But I don't know whether there are any DLLs that can do this.
Bresenham Algorithm is using memory address's for draw a line, I have a way to draw dynamic shadow's with lines but I found out that algorithm can be almost 15X faster than using the line slope, the logic is same but the way is shorter
 
E

elementbound

Guest
Bresenham Algorithm is using memory address's for draw a line
No.

that algorithm can be almost 15X faster
No.

Well, unless I'm missing a lot of additional context. draw_line is what you are looking for, which is way faster than writing your own CPU-based rasterisation in GML.

What are you drawing these shadows onto? A surface? A ds_grid? A buffer? Please provide a bit more info so we can help. Or, if you really want to set and get individual memory addresses for some reason, it would be easy to write a DLL in C. The C code would get an address as a double, which you first cast to an unsigned int, then to a void* and work with that pointer.
 
H

Hossein

Guest
No.

No.

Well, unless I'm missing a lot of additional context. draw_line is what you are looking for, which is way faster than writing your own CPU-based rasterisation in GML.

What are you drawing these shadows onto? A surface? A ds_grid? A buffer? Please provide a bit more info so we can help. Or, if you really want to set and get individual memory addresses for some reason, it would be easy to write a DLL in C. The C code would get an address as a double, which you first cast to an unsigned int, then to a void* and work with that pointer.
yes, you are right about dll I found it early but about other things I was a bit wrong , because iam new computer student and just using game maker for education, I done the shadow by draw line and for loop so, thanks for your replay
 
Top