Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - ViL

Pages: [1] 2
ASM / PNG library suited for tiny intros on masm?
« on: July 02, 2018 »

i've stumbled on PNGlib like it's the only png decoder for masm, it is the only one out there? this is the site of PNGlib

while it's considerably small, uPNG on C output is even smaller, counting kb; but some pairs of kb makes the difference on tiny intros :)

may i ask if anyone knows another png decoder for masm? :D

any idea is very welcome! x3

hii, Siekmanski! :) your example is awesome! x3 and Hitchkikr one is very useful too!, thanks a lot for sharing them! :D

i'm already happy about having opened this thread lol through i'm still very puzzled about not having found anyone ever explaining nor even talking about what happens to gouraud shade colors in quads on virtual machines, any idea is very appreciated too! x3

i was testing quads using multiple colors (gouraud-shade) and for some reason virtual machines either inverts the quad colors or vertex order

here's a screenshot

i did a test using the same exe in my host and guest virtual machine, at the left of their screen they are all three triangles, both quads at the right

also enumerated the vertex order in which they are drawn in the image, you can notice the quads color or vertex are inverted on the virtual machine

i tested in VMware and a friend also tested on VirtualBox, the result is the same on both, may i ask why this happens?

attached the exe and source, the assembly source is here if that's better

thanks beforehand! :D

While looking at Nehe's tutorial for opengl i noticed that they had a masm32 conversion for these examples, the tutorials start here:

then quickly realized the links were offline, but fortunately someone made a backup of most examples on github, including masm-converted ones, you can download them from here:

they used some definitions files that weren't included, luckily i found these .def files in the sources of a Northern Dragons' demogroup 4k intro named Trees, it was the only place to get them so i spread them here so you can compile and follow the great NeHe's tutorials!



please note that while these .def files are fairly complete, they don't have some opengl definitions; luckily the Trees' intro source also included the missing ones in an extra .def that i use too, here it is:


i made a example in masm using these .def too, the exe is 4kb unpacked but it features:
-screen scaling proportionally
-easy to customize resolutions
-fullscreen option that keeps the scaling ratio (set fullscreen to 1 in the .data group of the source)
-a colorful quad that takes the whole screen
-fairly minimal source to have a working pe-exe with opengl

edit: for some reason virtual machines inverts either quads color or vertices as unintendedly seen on the screenshot, a good workaround is to use two triangles instead of a quad, more information can be found here:


note that including .def files doesn't grow your exe file!

i hope the template is useful for anyone! :)

General chat / Re: Heyyyy wassup?
« on: June 29, 2018 »
welcome back, jace_stknights! :D also giving my good vibes on that things get better for you! x3

lol, and you are welcome! = D

hii, Siekmanski! and nope, i didn't knew about the forums!, seems like a huge source! x3

i'll be around to check some posts there, thanks for sharing it! :D

Hii Knruz and thanks for the tips!, i didn't knew about the first way! :D

After a lot of research i could figure it out and ported everything that tutorial shows to MASM32, i hadn't cleaned the source nor commented it but i think it is readable enough, though, if anyone got a question please tell me in a comment!

All options emit a sound (except exit :) ) This is how it looks like:

it's all just one .asm file:

you can download it, save it as main.asm, and compile it in MASM32 with these both commands (assuming you have MASM32 installed in C:\):

    C:\masm32\bin\ml.exe /c /coff /nologo main.asm

to assemble and

    C:\masm32\bin\link.exe /nologo /subsystem:windows main.obj

to link

i hope it may be of help to anyone! = 3

edit: attached exe and asm file in if that's better :D

Helloo! i've been looking for a way to add a menu using WinAPI within the same .asm file, without using resource (.rc) files

It can be done in C, like explained in this tutorial

MASM32's User.lib has the same function prototypes in there (CreateMenu, AppendMenuW, SetMenu)

This is for two reasons, one is because i'd like them not to be edited/spoted using Resource Editors, the other is that i want to keep everything on one .asm source file (as what i want to do is small enough)

I've not seen anyone documenting how to do this before in MASM32 (or even other Win32-targeted compilers) and ran out of ideas trying, any kind of help is very appreciated!

thanks beforehand! :D

yea, those includelib; reading further i realized they were stored in the obj file to tell link.exe to link those libraries automatically :D

it's way more practical than putting all the .lib in the linker command as i was used to (aside the command line is supposed to have a limit of 128 characters too)

and thanks too, Siekmanski! :)

 hii! i've looked for a way to manually set the libraries that link.exe includes, by default, when i link using:

Code: [Select]
C:\masm32\bin\link.exe /verbose /nologo /subsystem:windows /opt:noref main.obj
it says:

Code: [Select]
Start Pass1

Processed /DEFAULTLIB:C:\masm32\lib\user32.lib
Processed /DEFAULTLIB:C:\masm32\lib\kernel32.lib
Processed /DEFAULTLIB:C:\masm32\lib\gdi32.lib
Processed /DEFAULTLIB:C:\masm32\lib\opengl32.lib
Processed /DEFAULTLIB:C:\masm32\lib\glu32.lib

so i tried setting the /DEFAULTLIB's parameter myself to override them

Code: [Select]
C:\masm32\bin\link.exe /verbose /nologo /subsystem:windows /defaultlib:C:\masm32\lib\user32.lib /opt:noref main.obj
(i was intending to just link the user32.lib library to intentionally produce an error to see if it worked)

and regardless, it keeps adding the rest of default libraries:

Code: [Select]
Processed /DEFAULTLIB:C:\masm32\lib\user32.lib

Start Pass1
Processed /DEFAULTLIB:C:\masm32\lib\kernel32.lib
Processed /DEFAULTLIB:C:\masm32\lib\gdi32.lib
Processed /DEFAULTLIB:C:\masm32\lib\opengl32.lib
Processed /DEFAULTLIB:C:\masm32\lib\glu32.lib

is there a way to set them manually?

for example, i recall the same happened linking in mingw's gcc.exe when i coded in c, but using mingw's collect2.exe as a linker enabled me to link them manually, so i though it was possible too in masm

thaanks beforehand! :D

EDIT: turns out they weren't magically added BUT they all were called by using includelib in the asm source!

i'll let this post here if it ever helps someone lol

ASM / Re: Best assembler for win32 < 4k intros
« on: June 20, 2018 »
hii, Knurz! :D i've been trying masm32 and so far i am happy with the output size + it still can runs on windows 95!

tried to pack it using UPX and it got an average of 50%+ of compression! it is great for 4k too :D

thanks a lot, Knruz!, you rocks! x3

ASM / Best assembler for win32 < 4k intros
« on: June 17, 2018 »
hellooo! :D may i ask which assembler is better suited for < 4k intros for a 32 bits windows? = 3

thaanks beforehand! x3

Projects / Re: Something small...
« on: March 15, 2018 »
wow! this is a really cool intro! :D i love the text effect and star! x3 big props, man! = D

also thaanks a lot for the source too! = 3

@Knurz I'm so glad you liked it! +O+ also i'm amazed you are still willing to help even after it is released; thanks you so much, man! also wOW i never though about managing one long charset image with UV Mapping! that's so damn clever! =' D

also yea, they are very costly :c in fact that was made me have to shorten the greets ;-; rip BUT once i sort that out i'll ensure myself everyone that helped me on DBF are in this time x3

also absolutely! :D i'll have arrays or one recursive function that do the work of all the objects next time lmao, thaanks you so much for your useful hints and help! you rocks!~ =' D

@Rbz i'm very happy of your approval; thaanks, man!~ +O+

hii! :D i finally got to release our first intro with a couple of friends, this release was possible by many of you, DBF community and tuts4you forums; so it is dedicated to you as well! = D

unfortunately, and the reason i delayed a bit on posting it is that since it was my first time coding in C/C++ and had literally 25 days to relearn until the deadline, my code is mindblowingly unoptimized; i never seen such a mess before BUT it works at least  ;D

i told so many people they'll be in this one greets and my friends also wanted to greet a lot of people BUT we just had to limit it to just people in the BotB community where a compo this intro was aimed on is due to CPU extreme loads by each character on the scroller ;D a couple more of them and the intro'd lag hard ;-; so i'll promise next release you'll appear in! including Knurz, Rbz and combatking0 for all your support!, you rocks! =' D and my bad for now = 3

here's the youtube render:

the release on pouet:

and the source mess attached as well = p it comes with a Code::Blocks IDE project, since i made it there = 3

there was a lot more planned for this intro, including real time 3d rendering and moving camera BUT we went short on time and had to fallback on what we had by the time = p

i hope you enjoy it!~ x3

Hiii, Knurz! :D you are a wizard! +O+

everything works amazingly now, i never though i could get to this point; and it, as well as this intro would never be without all your kindness and help! =' D

now i got to implement it on the almost done intro, also a greetings is the least you deserve for being such a hero :)
all the K++! \o/

btw thanks about the glBindTexture hint! x3 and about the glPush and Pop Matrix it was a leftover since i though about using glTranslate on two quads! x3

also i'll link the intro + source code here once it's done!~ :D and once more; thanks a lot for everything, Knurz! =' D

OMG this works like a charm! :D you are amazing! +O+ thanks you so much! =' D K++ aren't enough, you deserve an spot on the intro greetings! x3

now it shows a nice snowflake on the screen! x3

made some modifications on the code BUT after some messing around trying to use a second snowflake texture, i couldn't find my way to use other texture than the first, this is the code:

how can i set another texture id? =' 3 it is the only thing left to beat to actually have everything that is left on the intro! x3 and my bad for asking too much :c i effort on make my "homework" before asking anything, and really have a hard time figuring out this, i'll appreciate any idea!~ x3

hiii, Knurz! first of all i am mindblowed about the amount of detail you put on your help, massive K++ for that! :D

i started to test PicoLodePNG right after you posted it, unfortunately i couldn't compile any of the examples there in Code::Blocks with the GNU GCC Compiler either .cpp files with the g++ option nor .c files with the gcc option, so i couldn't make it run

i also seek for other examples around the web and couldn't figure them out; my intro has .c extension so i can't #include <iostream> since that's exclusive for the g++ compiler; and using it makes it throw thousands of warnings LOL so i must use a .c file for it aka compile it with the gcc option

i understood how everything else worked! :D i am just stuck in loading a image with PicoLodePNG in my main.c from the hdd and set it to "myTexture" for instance x3

any help is very appreciated! thanks a lot, beforehand!~ =' D

Hii! i am almost about to release my first old-school intro with some friends! the only thing left is to know how to bind textures to a quad

i am working with opengl 1.1 as much as i can, for this intro to work on old windows/old integrated graphic chips, so i want to avoid libraries and do it as vanilla as posible also to learn from it! = p

i created a new opengl template in Code::Blocks to work in a cleaner environment, the code is as follow:

which output this nice square on the screen:

BUT instead i want to use this nice snowflake:

and since afaik i can't use png files without a library, here is the 24 bits bmp version with #FF00FF ( glColor3f(1.0f, 0.0f, 1.0f); ) background instead:

i attached the project folder here, i use the Code::Blocks; and has it's project file in

i have read the opengl 1.1 red book and the 1.1 super bible respetive sections, even got through over 500 threads here and can't find my solution

can someone help me with what to do to bind the snowflake texture to the quad, and it to show transparent?

thanks you so much before hand! the release of this oldschool intro is stuck by this, i apreciate any help! x3

Pages: [1] 2