Jump to content

  • Log In with Google      Sign In   
  • Create Account

Dave Hunt

Member Since 30 Dec 2002
Offline Last Active Today, 07:56 PM

#5165872 optymizations by self modifying code

Posted by on 09 July 2014 - 12:33 PM

There was a series of articles in Dr. Dobbs Journal detailing the optimization of Pixomatic for x86 processors. The first in the series is here - http://www.drdobbs.com/architecture-and-design/optimizing-pixomatic-for-x86-processors/184405765


There's a brief discussion of the self-modifying pipeline in that first article. I didn't spend any time trying to locate the subsequent articles in the series.

#5165604 some assembly unknowns

Posted by on 08 July 2014 - 12:10 PM

Is there an actual question in there or is this just YAFR (Yet Another Fir Ramble)?

#5165559 DLL Import Failure

Posted by on 08 July 2014 - 09:32 AM

If it's a true .NET DLL, then you shouldn't need to do any DllImport at all. Just add a reference to the DLL (right-click References in Solution explorer and click Add Reference...). When the project builds, it will automatically copy the DLL to the correct output directory.


If it's not a true .NET DLL, then you will need the DllImport and you need to manually place the DLL in the same directory as your app's .exe directory. That directory will be under either the Debug or Release directory under your project, depending on whether you're doing a Debug or Release build.


If the DLL depends on other DLLs that aren't in your environment path, then you'll need to either add references to them (for .NET DLLs) or copy them to your .exe directory as well.

#5161312 Code::Blocks: Process terminated with status -1073741819

Posted by on 18 June 2014 - 08:09 AM

Take a very close look at the first parameter of your load_map function...

#5160413 SDL Documentation

Posted by on 13 June 2014 - 08:39 PM

For the SDL.net API doxygen docs, look here: http://cs-sdl.sourceforge.net/apidocs/html/index.html

#5150936 Drawing Text with Dx11

Posted by on 02 May 2014 - 09:50 AM

Have you considered using the DirectX Toolkit?

#5147521 how to set a texture?

Posted by on 16 April 2014 - 08:32 PM

You might want to set the texture on the device before you draw the primitive. :-)


Also, you need to use an FVF (if you insist on avoiding shaders) that matches your vertex buffer (e.g. it needs to include D3DFVF_TEX1).

#5146957 what do i need to learn?

Posted by on 14 April 2014 - 12:48 PM

I would suggest you peruse the Visual Arts forum and check out all of the pinned topics posted there. That should get you started.

#5127874 SDL 2.0 - Edit Renderer Pixels

Posted by on 31 January 2014 - 07:41 PM

Excellent solution. That will keep all the work on the GPU. I didn't realize you were multiplying all pixels by the same value, or I might have thought to suggest something like that.


Glad you got it sorted!

#5127832 SDL 2.0 - Edit Renderer Pixels

Posted by on 31 January 2014 - 03:42 PM

The only way to do this all on the GPU would be to use the OpenGL renderer and do the post-processing in a shader.


There's no way to get at the pixels of the current frame outside of a shader. All the details of what a frame looks like are hidden behind the abstract SDL_Renderer. It could be a pixel buffer for software rendering, or a set of VBOs, etc., which would mean there is no pixel representation of the final image until it's actually flushed to the GPU.

#5127789 SDL 2.0 - Edit Renderer Pixels

Posted by on 31 January 2014 - 12:43 PM

You could keep a copy of the texture in an SDL_Surface, modify the surface as you used to, then SDL_UpdateTexture to get the pixels into the final texture. You should create the texture with SDL_TEXTUREACCESS_STREAMING to tell SDL that you plan on updating the texture frequently.

#5127537 SDL 1.2 to 2.0 migration (open screen a blit)

Posted by on 30 January 2014 - 01:31 PM

The SDL MigrationGuide pretty much hand-holds you through the process of converting a simple 2D app from 1.2 to 2.0.

#5127374 Is it practical to have two instance of a Game class object

Posted by on 29 January 2014 - 10:34 PM

If you don't want more than one instance of your Game class, then don't create more than one. There is no need to make it a singleton.


Whether it's practical to have more than one Game object instance or not would depend on its implementation, but it's unlikely to be a useful feature.

#5114133 [Directx 11] [2D] problem positioning a 2D quad , center starting at bottom...

Posted by on 03 December 2013 - 02:56 PM

Your l_spriteWVP matrix is wrong. The multiplication order should be scale * rotation * translation, not the other way around.


Also, I'm a bit confused by your matrix names and usages. You are including sprite position (translation) in your l_spriteWVP matrix, then multiplying that by another matrix (worldMatrix (which is really view * projection)) and setting that result on your shader as the world matrix. Then in your shader, you are multiplying the sprite position by the world matrix again. I'm pretty sure that's going to give strange results.


I would strongly recommend using the DirectX Tool Kit for sprite drawing. It's an official MS tool kit and takes care of all this for you. If you want to learn how to do it yourself, all the source code for the tool kit is available for your perusal.

#5114094 [Directx 11] [2D] problem positioning a 2D quad , center starting at bottom...

Posted by on 03 December 2013 - 12:32 PM

Swap the viewBottom and viewTop values for the orthographic matrix:


XMMatrixOrthographicOffCenterLH( 0.0f,(float)m_pRenderManager->GetWidth(),(float) m_pRenderManager->GetHeight(), 0.0f, 0.0f, 100.0f );


That should get 0,0 at the top-left of the viewport.