Recent Posts

Pages: 1 ... 3 4 5 6 7 8 9 [10]
91
C / C++ /C# / Re: [C] 64-bit XM player
« Last post by hellfire on May 14, 2013 »
Hi Rene,
why do you want to create a 64bit binary?
If you're working with Cuda anyway, you won't benefit much from 64bit code generation.
You probably won't need more than 2gb of memory, either.
And a 64bit binary rules out everyone who's still running a 32bit os...
92
C / C++ /C# / Re: [C++][OpenGL] Sine Scroller
« Last post by lucastar on May 14, 2013 »
Ok, i got a cute wave effect, but i can't get the character distorsion right.
Here is the example, for anyone who wants to try.
The method is _DrawChar on bmpFont.cpp class, and the z rotation seems to be working ok.
Sorry about the huge .rar size...
93
C / C++ /C# / Re: [C] 64-bit XM player
« Last post by rol1939 on May 14, 2013 »
Thanks for the hint, Raizor.
This morning I discovered that XMPLib contains a win32 directory, so I gave it a try with MINGW on my Windows 7 64 bit.
The DLL is compiled correctly after the "confgure, make" dance. However, the DLL was still 32-bit!  :vangry: After checking the MINGW website, I discovered that MINGW is only 32-bit at this time.
There is another project called MinGW-w64 that claims to be able to compile x64. Perhaps I try to install that.
When that fails, I will try to look at chibi-itplay.
 
94
Purebasic / Resouce Dialogs rc files
« Last post by dev0 on May 14, 2013 »
Hi,
well, this is not a question related to demos or intros its more general...
I started with PureBasic for a few days and now maybe someone can point me to the right direction using resource files.

The problem:
I've created an rc file containing a dialog with an image and a few buttons / checkbox. What I want to archive is to use that dialog while only using winapi. So no Gadget stuff involved right now. Showing that dialog wasn't a big deal so far but my problem now is: like I told before the dialog had an image when I store e.g. a bitmap for example inside the resource file, how can I display that bitmap in the dialog's image component?

Hopefully you understand what I mean its like when I use a resource editor, for whatever reason I can add the bitmap resource but I can't associate that to the image component on the dialog directly...

So I guess I have to do it from code itself?

regards
95
Freebasic / Re: bumpmapping
« Last post by hellfire on May 14, 2013 »
well i have too admit i didnt fully understand what was going on with your all your shifts

Well, what's probably not so straight is the normalization part - which would usually look like this:
Code: [Select]
int t= lightdir.x*lightdir.x + lightdir.y*lightdir.y + lightdir.z*lightdir.z + lightdir.w*lightdir.w;

// factor to normalize to -128..+128 with 8bit of fractional part
int invSqrt= (128*256) / sqrt(t);

lightdir.x= lightdir.x * invSqrt >> 8;
lightdir.y= lightdir.y * invSqrt >> 8;
lightdir.z= lightdir.z * invSqrt >> 8;
lightdir.w= lightdir.w * invSqrt >> 8;

But when multiplying two 16bit values with mmx you can only keep the upper or the lower word, like this:
Code: [Select]
pmullw: lightdir= lightdir * invSqrt;
pmulhw: lightdir= lightdir * invSqrt >> 16;

With pmullw you get an overflow when the vector exceed 0..255 (which it does),
with pmulhw the result gets 256x smaller than it's supposed to.
So I distributed the factor of 256 to both values, *8 to the vector and *32 to the invSqrt, ending up at:
Code: [Select]
invSqrt= (128*256*32) / sqrt(t);
viewdir= (viewdir<<3) * invSqrt >> 16;
Now the invSqrt doesn't fit into 16bit anymore for small values of t.
But that's not a big problem because it's impossible to normalize very small vector anyway (because 1/sqrt(0) = infinity).
So I just clamp the table-values at 32767 and accept that vectors shorter than 0.25 (32 at 7bits fractional) will be too short.

I choose a factor of 32 because at that point the lookup-table for invSqrt was much larger and I was looking up invSqrt[t>>5], so only the value of invSqrt[0] got clamped (which must be clamped anyway).
Now that it's looking up invSqrt[t>>10], it makes more sense to put the whole *256 within the invSqrt-table and remove the shift...
96
Freebasic / Re: bumpmapping
« Last post by ninogenio on May 14, 2013 »
i think ill probably go the fixed point mmx way mostly for memory bandwidth.

well i have too admit i didnt fully understand what was going on with your all your shifts etc so have spent the whole night tearing all my code down too a number by number basis and watching all the values in real time. i've learned stuff like fixed point reciprocal divides etc.. its really been a while  :).

ive fixed my range normalizing issues i had, tided it all up a bit and now its 4 core, i dont think it will use all the cpu though still haven't got round too getting into that. im still using 10 point shifts atm. my next job is too bring everthing into mmx range and try a bit of asm out.

150fps on my end at the moment.
97
C / C++ /C# / Re: [C++][OpenGL] Sine Scroller
« Last post by lucastar on May 13, 2013 »
Thanks to all, I'm trying to emulate that movement... it's difficult, I'm thinking about using GLSL xD.
As soon as i get close, I'll upload the SC.
98
C / C++ /C# / Re: [C] 64-bit XM player
« Last post by Raizor on May 13, 2013 »
A lot of the XM libraries I've come across contain inline x86 ASM, which does make it a problem for 64bit use.

chibi itplay would probably work, but it looks like you'll need to wire it up to DirectSound yourself. this forum post seems to have some relevant info. Sounds like there's nothing 'perfect' out of the box, but you should be able to get something up and running for x64 without too much hassle.
99
C / C++ /C# / [C] 64-bit XM player
« Last post by rol1939 on May 13, 2013 »
Just for fun, I created a sinescroller using nVidia CUDA. It all works fine.
But now, I want to add my favorite XM module as a music, but  I'm using Win 7, 64 bits. Unfortunately, there seems to be no XM player compatible with 64-bits.
Ufmod, mini-fmod all contain assembler, which does not link with 64-bits.

Does anyone of you know a XM player which can be linked with 64-bits C code?
The XMPLib does not compile with Visual Studio, so that is not working for me.

Greets, Rene Olsthoorn.
100
C / C++ /C# / Re: [C++][OpenGL] Sine Scroller
« Last post by Canopy on May 13, 2013 »
nice.. works on win7 x64 here as well with my radeon 6450 HD
Pages: 1 ... 3 4 5 6 7 8 9 [10]