Jump to content

  • Log In with Google      Sign In   
  • Create Account

incertia

Member Since 25 Nov 2011
Offline Last Active Oct 06 2014 01:00 PM

#5143601 \why can't I initialize a multidimensional C array with zeroes

Posted by incertia on 31 March 2014 - 07:45 PM

Use
int multArr[3][2] = {0};



#5143348 AES Encryption

Posted by incertia on 30 March 2014 - 07:59 PM

I don't have any Rijndael at hand with me right now, but this is a working version of Rijndael and you can just add some stuff to get the expanded key.


#5142593 DirectX 12 Announced

Posted by incertia on 27 March 2014 - 08:45 AM

Windows 7 support seems to be a key issue around here and I agree. With most PCs running Windows 7, it would be a shame for Microsoft to make this a Windows 8 or even Windows 8.1+ exclusive. However, if Windows 9 manages to be as successful as Windows XP and not as retarded as Windows 8 (why would you ever port Windows phone to PC?), we can probably throw the previous statement out the window.

If multi-threading support has been seriously improved, this will be a great plus to the game development and gaming industry. We no longer need to purchase super expensive CPUs with high clock speeds so that one core can do all the work. Instead, standard consumer level CPUs will no longer become the bottleneck for gaming enthusiasts.

Obviously this is the direct challenger to AMD's Mantle. However, I foresee this as being more successful than Mantle simply because it's not specific to a single brand of GPU. Despite AMD's promise that Mantle will be non-proprietary at some point, we don't know when and having Mantle only usable on GCN architecture right now does not seem very promising. If something like OpenMantle were to be developed though... That would be a game changer.


#5142588 The swapchain->GetBuffer() function 's problem.(d3d11)

Posted by incertia on 27 March 2014 - 08:37 AM

1. The function did not do anything to p_swapchain. The function is simply retrieving the buffer from the swap chain. You gave the function a pointer to your local pBackBuffer pointer, so the function can fill it with relevant information.
2. If you set BufferCount to 2, you do not need to generate more calls to GetBuffer. The back buffer is always stored at position 0 and this is the buffer you should be rendering to.
3. Setting the setting to DXGI_SWAP_EFFECT_DISCARD just means that the contents of the back buffer are discarded/erased when the buffers are flipped (i.e. you call Present).
4. You cannot really specify a certain type (i.e. int, char) in C++. Having Direct3D depend on RTTI (runtime type information) can also be a huge hassle so we work around that problem with universally unique identifiers (UUIDs). Each UUID is unique for each interface so the function can just compare interfaces to find out exactly what you are requesting.


#5124415 Accessing base class functions

Posted by incertia on 17 January 2014 - 09:32 AM

All base class functions are automatically inherited. All you need is a move() unless you overrode move, in which you would need Base::move().

But yeah, like //Lumia said, I never have to call a base class function if I overrode it, because I overrode it for a reason. If you find yourself needing to do this, try to break up your code into smaller bits and only override the parts that you really need to override.


#5122865 Programming practice

Posted by incertia on 11 January 2014 - 11:33 AM

You could start small and build upwards.
As in, first make a text based tic-tac-toe game. Then maybe upgrade it to Win32 to get the hang of basic graphics. Then maybe build snake/tetris/breakout, which are a bit more complex. Eventually you will feel comfortable enough to do most things.


#5087468 CreateWindowExW not setting window title

Posted by incertia on 19 August 2013 - 09:05 PM

Turns out that the problem was I was returning TRUE when handling WM_NCCREATE instead of forwarding it to DefWindowProc so the standard things were not performed.




#5086907 How to handle endianness?

Posted by incertia on 17 August 2013 - 06:04 PM

An article was written about this


#5051983 Microsoft WORD sizes

Posted by incertia on 10 April 2013 - 06:52 PM

I've heard that Microsoft WORD will always be 16-bit and DWORD will always be 32-bit. Is this because they change the types (say from unsigned long to unsigned short) whenever the system WORD size changes?


#5048468 How much will Windows hate me if I don't use RemoveProp

Posted by incertia on 30 March 2013 - 09:29 PM

I recently found a good way to send a useful pointer to WndProc through the use of SetProp() for use throughout the entire program loop, but I never actually removed it because I never found a good place to. So I'm wondering bad the consequences are going to be if I don't use RemoveProp().


#5048342 WireFrame using HLSL 5

Posted by incertia on 30 March 2013 - 10:48 AM

Why not just switch the rasterizer states?
//FillState and WireframeState have already been defined and created...
pImmediateContext->RSSetState(FillState);
//draw complete objects
pImmediateContext->RSSetState(WireframeState);
//draw wire objects



#5047487 breakout lives

Posted by incertia on 27 March 2013 - 09:37 PM

try setting all your matrices to identity matrices right before you draw the text. You might be translating the text without your knowing.

EDIT: Also, it appears as if glColor and glRasterPos are not OpenGL 4 compliant. They may have been deprecated because I can't seem to find them here.

EDIT2: Lighting and texturing may also effect the color of your text because it seems when lighting is on, a lighting equation is used to compute a new primary color for the rasterized pixel.


#5047484 breakout lives

Posted by incertia on 27 March 2013 - 09:24 PM

I'm not particularly familiar with OpenGL, but here are some good questions to consider. Are you sure (0, 2, 0) is actually within the window? Is your window background white (you're printing white text)? Does the current raster position refer to the bottom left or top left of a character? Try outputting the text at (100, 100, 0) and see what happens.


#5047462 breakout lives

Posted by incertia on 27 March 2013 - 08:26 PM

It would help if we could know what the problem actually was


#5044770 Opengl Rotate from and to a certain point

Posted by incertia on 19 March 2013 - 09:19 PM

So this is going to be pretty general, but I'm sure you can find out a way to do it in code.

You want to rotate from an angle, say theta, to a different angle, say phi, in a direction d (1 for CCW, -1 for CW) in a given time, say t, along the axis of your choice about a point (x, y, z). Your angular velocity then has to be about that axis, which gives you the angle you must rotate per frame to reach your goal in your goal time. However, FPS can change so you must recalculate omega accordingly.

So you now know how fast you're rotating the object, but you're not quite sure how to get to rotate about a certain point. What you do know is that OpenGL provides support for rotating about the origin, so you can subtract (x, y, z) from your point P to center your rotation around the origin, rotate, and then add back (x, y, z). As such, we our transform becomes P = Rotate(P - (x, y, z), omega) + (x, y, z), and you're done.




PARTNERS