pouët.net

Integer VS Fpu

category: general [glöplog]
Gargaj, it's opensource, just change some stuff :)
added on the 2004-05-04 22:38:32 by lodda lodda
kusma: using floats for counters can make sense if your framerate aint fixed

optimus: you don't really want "putpixel" :P
added on the 2004-05-05 03:15:57 by xyz xyz
hermes: timers != counters
added on the 2004-05-05 10:39:32 by kusma kusma

The comments are interesting, but something diferrent now..

I tested TinyPTC, it seems fast, but since C++ and APIs are still like a blackbox for me, so weird things are happening that made me stopped coding and play some Serious Sam to forget my nerves..

I compiled the test.c programm from TinyPTC and everything was fine (but I still had to make something before making the project to work. How much do I hate when I load a project file done by others, I don't have any fuckin idea of what anything means, and I still get errors :P Makes me feeling that I have no fuckin idea)

Then I just wrote:

float f;

and then for example

f=0.1;

inside the main code
and I surprisingly get an error message for the most simple thing..

test.obj : error LNK2001: unresolved external symbol __fltused
release/test.exe : fatal error LNK1120: 1 unresolved externals

Well,. the problem might be stupid, but such things dissapoint me from starting programming on C++, why the hell happens that, since it does work on a NeHe project or DirectDraw project I tried? To write the most simple thing you know it's a part of C++ and not of an external library I didn't linked (Or not?). Anyways,. tell me what to do and save my wondering..

Uhg..

p.s. Also,. my brother wants that I render something on the screen for some credits of a small movie and save it in a video file. Of course, I can tell him to use a programm for that if I don't manage to do something myself,. but he wants and I want to know if I can render something with either DirectDraw or OpenGL and send the frames to an AVI or any video file? Or a programm which can record each frame played on the screen to video. Does a command from DirectDraw (something from DirectShow) exists for that? To render on a video file..

p.p.s. Save my question about the first problem first,. still can't beleive why I can't use a simple floating point in this project file..
added on the 2004-05-05 11:01:45 by Optimus Optimus
Optimus: that's because you use /nodefaultlibs to compile it, check e.g. the fr+hjb-art source, search in csipd / other ngs for a way around it (if you want small executeables) or simpler: just don't do /nodefaultlibs.
added on the 2004-05-05 11:07:07 by jar jar
Mmm,. what are nodefaultlibs and how can I remove them?

The problem is that I just click on the project file and everything opens automatically, without me knowing what's going on. I knew it that because the example wants to be of small size, something bad was going on that I can't see :P
added on the 2004-05-05 11:13:51 by Optimus Optimus
Just uncheck the "Ignore default libs" box in the linker settings => Alt-F7 / Project Settings / "Link" tab / "Ignore all default libraries", should be around there somewhere, make sure it's cleared.
added on the 2004-05-05 11:16:39 by Gargaj Gargaj
As for rendering a video, the best would be prolly just writing consecutive BMP files with the name of 0001.bmp 0002.bmp etc, then allowing VirtualDub to handle the actual AVI creation.
added on the 2004-05-05 11:18:32 by Gargaj Gargaj
/nodefaultlib is a linker setting, it just tells the linker not to link to the standard library (which holds functions like printf(), sin() etc.)

it's in project settings->link->ignore all default libs in MSVC6.

you'll probably also need to undefine __PTC_WINMAIN_CRT__ in tinyptc.h and change int main() to int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) other than that, the code shouldn't need any changing. If you still find it too hard i'll gladly make you a new workspace file so you won't have this as an excuse not to code ;)
added on the 2004-05-05 11:19:14 by jar jar
Optimus, that's because you are using some clumsy IDE that hides important options behind a maze of windows, icons, menus and proprietary binaries. Be a real programmer and switch to gcc instead.
added on the 2004-05-05 11:23:32 by 216 216
YES DEATH TO IDEs, AGA, FPUs AND HARDWARE ACCELERATION
added on the 2004-05-05 11:25:09 by jar jar
AND SOUNDCHIPS TOO!
added on the 2004-05-05 11:26:43 by Gargaj Gargaj
Quote:

Optimus, that's because you are using some clumsy IDE that hides important options behind a maze of windows, icons, menus and proprietary binaries. Be a real programmer and switch to gcc instead.


And the big laugh is that he probably means it too :D

Why would Visual Studio have to suffer for Optimus' relentless stupidity? Really, if you're TOO MUCH OF A FUCKING LOSER TO KNOW ABOUT SILLY ISSUES LIKE THE ONE POSTED BEFORE, OR AT LEAST TOO STUPID TO FIND OUT AFTER YOU COLLIDE WITH ONE, THEN PLEASE..


PLEEEEEEEEEAAAAAAAASEEEEEEEE..


Give up!
added on the 2004-05-05 12:10:38 by superplek superplek
Some people just shouldn't start coding nor talk about it. Period.
added on the 2004-05-05 12:11:43 by superplek superplek
Yep, but it should still be mentioned that the example tinyptc-project is kinda silly set up. As so much other details about tinyptc...
added on the 2004-05-05 12:20:18 by kusma kusma
Maybe Opti should try this:

BB Image

it's simple, effective and should not create many problems for him. He could even show it at a wild compo.
added on the 2004-05-05 13:26:32 by moT moT
:DDDD
added on the 2004-05-05 13:28:46 by Gargaj Gargaj
It works now without that nodelistthing....

I can code some stupid plasmas and did checks with FPU and Integer and I found out that FPU sucs! Well,. it's impressively fast here on my Athlon but integer still does it better! At least for the kind of effect I tried as a test..

The matter is not that. The matter is some more questions:

FULLSCREEN? Some #include or something but what?

TIMER? OpenPTC does have, perhaps I could try that too..

VSYNC? I do need that. How can I do it? And don't tell me about the timer because that's the reason why 2d scrollers are jerky these days. People don't use Vsync..

Perhaps more: Mmm,. how can I put ASSEMBLY? I'd like to try something because I beleive that the plasma is very slow on the Pentium2, but I can still write compiler code faster, this was just a test..
added on the 2004-05-05 13:45:15 by Optimus Optimus
>Gerard Jorling

To know what? Modern compilers are black boxes for nothing, even people writting tutorials couldn't answer for sure about some things. I removed that nodeshit from a plg, dsp something file,. project file of the millions of files (and the 5MB files on release debug,. OMG!!!), and it's name couldn't tell me anything. And there were a lot of things I couldn't answer and I don't know a tutorial explaining these shit and nobody did, just told you "get the framework and make some gfx work and forget the rest",.. so who fucks you and the stupid compilers anyways..

Why not a simple compiler, like Quickbasic (just with more speed and memory), where you have a BAS file, you write simple command and you press RUN? In my eyes, modern bloated compilers still sucks. However, I'd have to bare with this shit now, but be aware because I am gonna make a compiler in the future which will be my ultimate and only tool and I will erase all the other shits. At least I have reasons to do one. And don't laugh, I am a Capricorn and the revenge comes delayed but does come..
added on the 2004-05-05 13:51:17 by Optimus Optimus
FULLSCREEN? Some #include or something but what?

tinyptc.h, undefine __PTC_WINDOWED__ or something like that

TIMER? OpenPTC does have, perhaps I could try that too..

Shitty as it is, GetTickCount() is the easiest way.

VSYNC? I do need that. How can I do it? And don't tell me about the timer because that's the reason why 2d scrollers are jerky these days. People don't use Vsync..

You'd have to code a bit of DDraw for that. Don't.

Mmm,. how can I put ASSEMBLY?

like this:
__asm {
mov optimus,happy
}
added on the 2004-05-05 13:56:09 by Gargaj Gargaj
i think that some people clearly have never been told about how to use fpu efficiently, so i will introduce a FAST way to multiply 2 floats together - the basics, really:
float f=21,g=3.14159;
int* pf=(int*)&f,*pg=(int*)&g;
*pf*=*pg;
there you go!
added on the 2004-05-05 14:09:44 by stil stil
Quote:

To know what? Modern compilers are black boxes for nothing, even people writting tutorials couldn't answer for sure about some things. I removed that nodeshit from a plg, dsp something file,. project file of the millions of files (and the 5MB files on release debug,. OMG!!!), and it's name couldn't tell me anything. And there were a lot of things I couldn't answer and I don't know a tutorial explaining these shit and nobody did, just told you "get the framework and make some gfx work and forget the rest",.. so who fucks you and the stupid compilers anyways..


Not knowing the powers of and how to handle a professional development environment has nothing to do with it being 'stupid' or 'obsolete'. Besides that, it doesn't have all that much to do with the VC++ compiler as is. And besides that, those tutorial-writers you addressed are clearly fools if they couldn't tell you that the 'fltused' thingy is a symbol declared in the supplied run-time libraries.

Quote:

Why not a simple compiler, like Quickbasic (just with more speed and memory), where you have a BAS file, you write simple command and you press RUN? In my eyes, modern bloated compilers still sucks. However, I'd have to bare with this shit now, but be aware because I am gonna make a compiler in the future which will be my ultimate and only tool and I will erase all the other shits. At least I have reasons to do one. And don't laugh, I am a Capricorn and the revenge comes delayed but does come..


C and C++ to a certain extent *are* simple languages, and the compilers are quite simple too. The key is to understand them. Really. You're just operating on another level, introducing different forms of complexity and other hurdles; mostly ones that might be more difficult to understand for the incompetent programmer. Such as you, obviously. When I moved from (MS-)DOS assembly programming to Win32 5 years ago I also ran into issues like this. The key is to be constructive towards yourself and find out about solutions and most importantly reasons. That's called learning. And it works better than bullshitting forums, showing off your own lack of knowledge. Trust me on that one.

Just as with the whole "pixel shader" deal (Ryg emphasized it correctly that time), please stop bullshitting about and telling off proven technology just because you're not competent enough to work with it. That's a bit unfair!
added on the 2004-05-05 15:09:20 by superplek superplek
Using Integer maths is obviously faster on machines that don't have an FPU, e.g. some PDAs or the classic Amiga. So the "question" was quite okay but the context was missing. Not everything is PC with C++.
added on the 2004-05-05 15:49:01 by noname noname
I don't think anyone would question that.
added on the 2004-05-05 15:59:29 by superplek superplek
well, naturally everything that matters is PC with C++.
added on the 2004-05-05 16:50:21 by skrebbel skrebbel

login