@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2



Comments:

<0> how can i kill the chiled from fork() without killing the parent? exit(0) does that?
<1> calling exit() in the child?
<2> send it a signal?
<0> i want to kill the chiled
<0> how ?
<2> that was quick.
<2> wrong button?
<2> fork() returns the child's pid, use it with kill().
<0> :)
<0> tnx twkm
<2> sure.
<2> c-bot: tell [E]Razafk about kill
<3> [E]Razafk, here you go: kill - #include <signal.h> int kill (pid_t pid, int signum) Signaling Another Process (POSIX.1) see - http://www.msunix.co.uk/manual/glibc-2.2.3/html_chapter/libc_24.html#SEC500
<4> whaou
<4> crossposting
<4> wonderful



<0> ok tnx twkm
<0> i go to sleep bb
<5> I'm trying to declare a function pointer in C++, but I keep getting this error: cannot convert from 'void *' to 'void (__cdecl *)(int).
<5> here is the code: void (*getAddress)(int x) = (void *)0x4b8b60;
<6> try #c++
<5> right.
<5> sorry
<6> ;)
<7> thx
<7> hello, i need some .h files, where can i get them plz
<7> ok
<7> hi
<7> i need help
<7> ? no one :(
<2> what's the issue?
<7> i wanna use socket, what library should i install
<2> depends on the platform.
<7> linux, im using LCC ide
<2> generally no library is needed beyond libc.
<7> thx
<0> whats wrong here? kill(getpid(), 0); (this is a chiled proccess, and im tring to kill it)
<2> hmm.
<8> he apparently didn't bother to read the man page
<8> it very clearly states what the 2nd argument = 0 does nothing
<9> That, or he killed his IRC client's pid
<8> int kill(pid_t pid, int sig);
<8> If sig is 0, then no signal is sent, but error checking is still performed.
<8> also, kill sends signals, it doesnt actually kill a process and the signal number for termination is 9
<2> getpid won't return a child's pid either.
<2> terminating yourself is far more easily done with exit.
<8> right
<2> but he'll never know all this, since 2 minutes of patience is all he can muster.
<8> getpid is for current process and getppid is for parent... why wouldnt getpid() return pid for child?
<2> if called in the child it will. somehow i got the idea that he's trying to kill the child from the parent.
<8> probably, oh well
<8> in other news... im trying my first directx application, very simple 2d game... i get only 80 something fps in window mode 1024x768
<8> i thought this may have to do with the ~200 or so textured quads i had on the screen, but i commented the code out for 192 of them and it didnt affect the frame rate
<8> now to figure out how to alphablend them
<9> Turn off vsync
<9> (it's in the present parameters)
<8> ooo vsync may be it.. my refresh rate is 85 and i was getting 83 or 84 fps
<2> heh.
<8> is it possible to turn vsync off in window mode? or that can only be done in full screen?
<8> actually i just went to my video card advanced junk and vsync is already off
<8> although if vsync is always on in window mode then that may be the problem... however i did a test. i opened up counter-strike in window mode and it was getting 99 fps
<9> In D3DPRESENT_PARAMETERS
<9> PresentationInterval
<9> D3DPRESENT_INTERVAL_IMMEDIATE <=
<9> (default is ONE, which is the refresh rate)
<9> (and it's not the same as the fullscreen refresh rate, which is another member)
<9> Basically one specifies the Hz for fullscreen mode, and presentation interval is 1/1, 1/2, 1/4, immediate, or don't wait
<8> this is the 3rd param for Present() right?
<9> Ehm, dunno, it's a struct..
<9> Don't remember Present taking anything other than regions and a HWND
<2> glxgears runs the same frame rate whether i enable or disable vblank sync on my nvidia. perhaps that's funny.
<9> The driver parameter is just the default, it doesn't prevent the application from changing it
<8> i see
<8> I hadn't specified PresentationInterval in my code previously, so it was just left to 0
<9> Which is the default (vsync)
<8> now im getting 2400 fps
<9> Just a bit faster



<8> well i still have 192 of those textured quads disabled
<2> heh.
<2> nicer card than mine. (whimpy 5200fx)
<9> Even a 5200fx can do plenty with 8 quads heh
<8> now im only getting about 305 fps with all 200 of the textured quads
<9> How do you draw them
<2> glxgears only gets me 1200.
<8> i have a decent card though... geforce 7800gt... i suspect my drawing routine ****s, i found it in a tutorial
<8> ill paste the code, it will take a min to gather it though
<9> Normally you'd create some index buffer, some vertex buffer, and have a single draw
<8> http://rafb.net/p/1YoSgK46.html
<8> the Blit() and Blit3D are from a tutorial on doing 2d with D3D9
<8> ive not modified them
<9> Ah, no wonder it's slow heh
<8> I read that locking a vertex buffer is expensive, but i dont know if there's an alternative... im not really going for top performance, but when i was only getting ~80fps earlier i was a bit worried
<9> Sure there is, lock it only once
<9> And use the vertex buffer for the 200 quads
<9> + if your quads are connected they share plenty of vertices
<8> the way the example works is lock(), set vertex coords, unlock(), settexture(), drawprimative()
<8> the quads are connected, but i dont necessarily want all of them visible simultaneously
<9> So instead you have lock(), set vertex coords for 200 quads, unlock(), KEEP THE VERTEX BUFFER, then use the index buffer to draw
<8> it basically creates a grid of 16 wide and 12 tall blocks
<8> actually nm they arent all connected
<9> Doesn't matter if they are not all connected, you can still share plenty of vertices for the ones that are
<9> Simple example, you have two quads next to each other
<9> -----
<9> | | |
<9> -----
<8> well actually none of them are connected..
<8> they all overlap eachother
<9> Say you render clockwise, so |\|\|
<9> (still doesn't matter)
<8> each texture is 64x64 pixels, but i want to display 60x60 blocks
<9> In the vertex buffer, you'll put all these vertices
<9> Then in the index buffer
<9> You put the index to the vertices you want
<9> So [0,1,2,2,1,3] for the first quad, or something
<9> Put all the indices to build your triangles
<8> how do i go about specifying which quad gets which texture after i unlock?
<9> You just change the active texture before drawing a quad
<9> So, anyway
<9> All the vertices in a ONE vertex buffer
<9> (order doesn't really matter)
<9> All the indices in ONE index buffer (sort the triangles so that the ones with the same texture are next to each other)
<9> Then draw all the triangles (and multiple quads) at once, for each texture
<9> (it's DrawIndexedPrimitive())
<8> ty ill try this after i get the main game logic done
<8> i had initially done this game using wxWidgets which in turn used GDI and well... it was HORRIBLY slow
<8> on my system I couldn't even get 30fps with cpu maxed
<9> If you want performance, you need to control the low level stuff
<8> although part of this may have been due to my alpha blending algorithm which probably wasn't optimal
<8> I don't really need performance, but i want even ****ty computers to be able to get at least 40 fps
<9> Hmm GDI+ has alpha blending built-in
<8> I wasn't aware of that.. i did it pixel by pixel using lookup tables
<8> actually i guess it was byte by byte... 24bit lookup table would have been huge
<8> mine was only 64kb
<8> hmmm i try turning alphablending on and now it appears as though it's ignoring the alpha values that were already in my texture
<9> You need to change the texture stage blending
<8> d3dDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE);
<9> What's the 2nd one?
<9> And the operation?
<8> d3dDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
<8> ?
<9> So it's doing alpha arg1 * alpha arg2
<9> But then you don't specify arg2
<9> And by default it's temp
<9> You want D3DTA_TEXTURE
<8> for the OP?
<8> hmmm same results when i use d3dDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE);
<8> whops
<8> same results when I use D3DTA_TEXTURE for the ALPHAOP
<9> alphaarg1's default is D3DTA_DIFFUSE already
<9> You need to set D3DTSS_ALPHAARG2 to D3DTA_TEXTURE
<9> A texture is not an op, ops are modulate, add, etc


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c
or
Go to some related logs:

#AllNiteCafe
#php
zobb f'halqha
fc5 init 3 problem
opposite of confirm
#linux
drcyanide
#linux
#MissKitten
jenifervideo



Home  |  disclaimer  |  contact  |  submit quotes