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 - Knurz

Pages: [1] 2 3 4 5
1
ASM / Re: Best assembler for win32 < 4k intros
« on: Yesterday at 09:39 AM »
Hi.

I think MASM32 is the most common Assembler if you want to use Intel Syntax. For AT&T I do think it's the GAS Assembler.

http://www.masm32.com/
https://www.gnu.org/software/binutils/  (try minGW)

 :cheers:

2
Projects / Re: The Papillons Remake
« on: June 02, 2018 »
Just to be sure, I'm not against vc runtime or anything like that :)
I'm pointing it out because most of users don't know how to fix it by installing msvc redistributable package thing.

That's why I would like to get rid of it =).

Quote
What I do these days is to simple setup on "Code Generation" - "Runtime Library" to "Multi-threaded (/MT)" and the vc runtime will be static linked to your executable file. Sure the file will increase in size but well.. AV programs today are so annoying that you can't have small executables anymore anyway :(

Nice thanks, I'll try that =).
It's annoying and I didn't even bother to upload a compressed version.

[/quote]
Another way is to follow this tutorial and complete remove c runtime lib usage (prepare to have some fun ;) ).
[/quote]

I think I'll go with the static link approach =)

Thanks!

3
Projects / Re: The Papillons Remake
« on: June 02, 2018 »
Nice remake!

Consider removing the use of "VCRUNTIME140.dll" and it will be perfect :)


Thanks! =)

After "dumpbin'ing" the VCRUNTIME140.dll I found that this dependecy seems to come from my usage of memcpy/set.
Any suggestions how I can link it to a non-VC-RT dll (I wasn't aware that using the mem-functions opens up a new dependecy).

4
Projects / Re: The Papillons Remake
« on: May 27, 2018 »
Thanks Padman =)

5
Projects / The Papillons Remake
« on: May 25, 2018 »
Hi!

I loved this intro back in the days - fast scroller, raster effects and catchy chiptune.
Excuse the bad quality of the logo, I'm such a fail at GIMP/PS..  :crutches:

Source included, only unpacked version attached..

Have fun guys =)

6
Mhh I don't think that this is a PureBasic related error. What I see is that some library that you're using in your Purebasic code is missing some functions, but this functions should be included in your C-runtime (printf, sscanf...). You can find this error with other languages too, this seems to be a Mac specific error. If you can add this -lSystemStubs to the gcc (I just assume purebasic converts your source to some kind of c/c-- and compiles the c-code) which builds the binaries you should be fine.

Another approach that wouldn't require a rebuild of the library is to repack the library, this is only possible if the library is static and an archive.
I don't have a mac to try this, but the linux archives accept this stuff:
Code: [Select]
root@vdr:~# find /usr/lib -name "libc.a" | grep x86_64
/usr/lib/x86_64-linux-gnu/libc.a
root@vdr:~# ar t /usr/lib/x86_64-linux-gnu/libc.a |grep ^printf.o
printf.o
root@vdr:~# ar x /usr/lib/x86_64-linux-gnu/libc.a printf.o
root@vdr:~# ls -la printf.o
-rw-r--r-- 1 root root 1440 May 18 20:13 printf.o
root@vdr:~# file printf.o
printf.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
root@vdr:~# ar q libsupp.a printf.o
root@vdr:~# ar t libsupp.a | grep printf.o
printf.o

This would provide the libsupp.a (some random library I copied) with the binary routines of printf..

Viel Glück bei deiner Macspielerei :P



7
nice machine you got there with the A4000 =).

Did you try to update the archive's index with ranlib ?


8
Third run: see Problem3.pdf
I have no Idea what to do?
EDIT: Seems to be my problem, but how do I fix this: https://www.mac-help.com/threads/library-out-of-date-rerun-ranlib-1-cant-load-from-it.104449/
Quote
Because you need to re-run ranlib whenever the modification date of a .a file changes.

Doc

I'm not a Basic or MacUser, but it says what you should do: rerun ranlib. http://sourceware.org/binutils/docs-2.30/binutils/ranlib.html
You have some native *.o files packed into a zip-like archive which ends with .a. The Linker (LD) has to know which object in this archive exports which function (by reading an index), because it has to link your calls to the specific .o file (and it's corresponding function) in the archive. If the information is out of date, the linker would be able to jump into a memory of the archive that is void and your program would crash. ranlib updates the index for the archive, which should remove the error.

Code: [Select]
31300034@NL-00126:~$ ar t /usr/lib/x86_64-linux-gnu/libresolv.a
gethnamaddr.o
res_comp.o
res_debug.o
res_data.o
res_mkquery.o
res_query.o
res_send.o
inet_net_ntop.o
inet_net_pton.o
inet_neta.o
base64.o
ns_parse.o
ns_name.o
ns_netint.o
ns_ttl.o
ns_print.o
ns_samedomain.o
ns_date.o

Code: [Select]
31300034@NL-00126:~$ ranlib -U libresolv.a
31300034@NL-00126:~$ echo $?
0

Bye!

Off-Topic: Man you have an archimedes at home, which model do you own ? I own an A3010 =)



9
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

Thanks =). Unable to paint anything, I have to use something simple  ::)

You're welcome, it's not very good with comments, if you have any questions, just contact me.

10
Projects / Re: Something small...
« on: March 10, 2018 »
That is really neat!  :goodpost:

Appreciate, glad you like it  :||

11
Projects / Re: Something small...
« on: March 08, 2018 »
Thanks!
Works pretty fine now, very oldschoolish intro for sure  :D

Looking forward to see more GL3 experiments :)


I'm very glad it did not crash  ;D

Next one will be a little bit longer =)






12
Projects / Re: Something small...
« on: March 07, 2018 »
Hi Rbz!

I edited my first post and attached an i3_unpacked.zip, which contains the non-packed executable.

(didn't use kkrunchy for that reason, but bero's packer seems to be on the blacklist too).


13
@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+

Hey! Glad I could bring some ideas to you.. probably everyone did his first scrolltext like you did  =).
Hope to see more prods from you and your team in near future!

Have Fun! =)

14
Projects / Something small...
« on: March 04, 2018 »
Hi!

I played around with GL3 a little bit the last two weeks and want to show what the result of my journey is =).
Nothing big, just a one-screener Amiga-like intro.

As always, source included. In the source.zip is a file called wobjbin.c, which is an importer for 3D-Formats based on assimp (http://assimp.sourceforge.net/). It's written on linux, using gcc-32, so you may run into troubles compiling it on win.

Have fun!


15
General chat / Re: The Welcoming Committee
« on: March 01, 2018 »
Yeah, we need more C Coders onboard =)

 :hi:

16
Very well done mate! I like the style you aimed for very much (just watched the yt video, bc I only have linux in the office).

I downloaded the code too and you put ALOT of lines and work in to that. Just one thing I saw in your code.

You're loading one single char into a texture, which is technically fine, don't get me wrong, but it's alot to write and alot to compile =).
I just wanna give you an idea to make font-printing/scrolltexts easier. Remember the UV-Mapping we talked about in the other thread you openend ?
Let's say you have an image where ALL of the character you want to use are in a row like: ABCDEF... and so on.
You could upload the whole image into a texture and use the UV-mapping to "cut" one character from the texture and map it to the quad you're using.
(If you need some example codes, I'll can post them here).

Try to avoid too much usage of glPop/glPushMatrix (GL has to do stack-operations every time, which could consume more time than you have left for a single frame).

Try to use more arrays, it'll help you ALOT cutting down the lines of your sourcecode, like the further_snow_transparency_* variables. Just an idea if you say
Code: [Select]
float further_snow_transparency[20];
You could cut down the source by simply doing a iteration over the array:
Code: [Select]
for (int c=0; c<20;c++) { further_snow_transparency[c] -= (float)(rand() % 27583) / 100000.f; }
You can do this ofc with further_snow_v_move too =).

Again, lovely visuals, nice sound, very well done!

K++


17
Hi!

Oh no you're giving me too much attention =). Glad I could help and thanks that you will release the source!


18
I'm glad it worked! (greetings are always appreciated :D)

If you want to use different textures in your project, just load another file with UPNG and do the stuff you did with the first texture again(glgentextures, glbindtexture, glteximage2d...) but with the 2nd texture to upload it to your GPU.  After that, you can simply switch the current texture by using glBindTexture with the new texture-id again:

Code: [Select]
glBindTexture(GL_TEXTURE_2D, texture);
glBegin(GL_QUADS);
  glTexCoord2f(0.0, 0.0);   glVertex2f(-0.3f,   0.3f);
glTexCoord2f(1.0, 0.0);   glVertex2f(0.3f,  0.3f);
glTexCoord2f(1.0, 1.0);   glVertex2f(0.3f, -0.3f);
glTexCoord2f(0.0, 1.0);   glVertex2f(-0.3f, -0.3f);
glEnd();

glBindTexture(GL_TEXTURE_2D, texture_2);
glBegin(GL_QUADS);
  glTexCoord2f(0.0, 0.0);   glVertex2f(-0.3f,   0.3f);
glTexCoord2f(1.0, 0.0);   glVertex2f(0.3f,  0.3f);
glTexCoord2f(1.0, 1.0);   glVertex2f(0.3f, -0.3f);
glTexCoord2f(0.0, 1.0);   glVertex2f(-0.3f, -0.3f);
glEnd();

Just be sure that you don't mess around with texture within your glbegin...glend block, this would probably result in an error.

Something to consider in your project..because I saw it in your code.. you're calling glBindTexture(...) twice. First you do the preparations for the texture, then you bind it again. This isn't necessary, because GL is a "state machine", everything you set stays in it's state until you change it. You're calling glPushMatrix() and glPopMatrix() without doing any matrix operations within it's logical block.  (I'm just saying because GL calls are limited and expensive)

Happy coding! =)

19
Hi!

You're very welcome =).

If you're using ANSI-C you could use https://github.com/elanthis/upng UPNG.

UPNG compiles without any prerequisites with gcc:
Code: [Select]
majortom@vdr:~/coding/c/upng/upng$ gcc -c upng.c -o upng.o
majortom@vdr:~/coding/c/upng/upng$ echo $?
0

Here's an example (png = compressed PNG, pngsize=size in Bytes of png):
Code: [Select]
GLuint createTexturefromPNG (unsigned char *png, size_t pngsize, GLint filter) {
GLuint texture = 0;
upng_t *pngt;
unsigned int format = 0;

glGenTextures(1, &texture);

if (!texture) return (texture);

pngt = upng_new_from_bytes(png, pngsize);

upng_decode(pngt);

if ( (upng_get_error(pngt) != UPNG_EOK) || (!texture) || (!pngt) ) {
if (pngt) upng_free(pngt);
return (0);
}

format = upng_get_format(pngt);

glBindTexture(GL_TEXTURE_2D, texture);
glTexImage2D(GL_TEXTURE_2D, 0, format == UPNG_RGB8 ? GL_RGB : GL_RGBA, upng_get_width(pngt), upng_get_height(pngt), \
0, format == UPNG_RGB8 ? GL_RGB : GL_RGBA, GL_UNSIGNED_BYTE, upng_get_buffer(pngt));
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter);
glBindTexture(GL_TEXTURE_2D, 0);

upng_free(pngt);

return (texture);
}

This only supports RGB and RGBA Images - no other fancy stuff.

What I forgot to mention in my first reply is that you have to glBindTexture(GL_TEXTURE_2D, <your_texture_id>); before rendering your object.

Bye!

20
Hi!

Last question first, you can use PNGs without any libraries, there are many PNG decoders out there, like http://lodev.org/lodepng/picopng.cpp (which I prefer, because of it's size).

Let's assume you have the image in RGBA Format uncompressed in memory, first of all you'll have to tell GL to generate a texture:
Code: [Select]
glGenTextures (1, &myTexture);
You'll have to bind the texture for the operations to follow:
Code: [Select]
glBindTexture (GL_TEXTURE_2D, myTexture);
And you'll have to describe to GL what size and format your image has (please take a look at the API Manual, there are many options!):
Code: [Select]
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, myTexture_width, myTexture_height, 0, GL_RGBA, GL_UNSIGNED_BYTE,  uncompressedMemoryTexture);
If you have done any errors in your previous steps, you will notice it when calling glTexImage2D =).
We can change the filtering of our texture:
Code: [Select]
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

After you've done all that, unbind any texture:
Code: [Select]
glBindTexture(GL_TEXTURE_2D, 0);
Somewhere in your code you have to enable the usage of textures:
Code: [Select]
glEnable(GL_TEXTURE_2D);
In your code where you do the rendering you'll have to pass a UV-Coordinate to every vertex you pass to the pipeline to tell GL how to map the image onto the vertex.
Imagine this:


and use glTexCoord2f(s,t) and pass the coordinates to gl.

Nehe has good examples for mapping: http://nehe.gamedev.net/tutorial/texture_mapping/12038/

Bye =).

Edit:

Transparency is very tricky to do right because you have to be very cautious to order your vertices from the most far to the closest one.
But a quick answer would be:
Code: [Select]
glEnable (GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

Pages: [1] 2 3 4 5