Jump to content

  • Log In with Google      Sign In   
  • Create Account


We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.

Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Member Since 27 Jan 2011
Offline Last Active Jul 20 2013 08:49 PM

#5078323 Does the Windows 7 interface (GDI?) utilize the framebuffer?

Posted by Dimension10 on 16 July 2013 - 06:27 PM

Right now, I'm working on a method for quickly grabbing the average screen color and spewing it out to my arduino to control my room's RGB strips.



I've been using mostly device contexts like GetDC(NULL) and then using StretchBlt to "stretch" it down to one pixel. But that seems like a ludicrous number of calls in total. I see about 15 fps and 6% cpu usage. (When grabbing one pixel, it's probably 100+ fps with <1% usage.)





But, I've heard there's a way to directly access the GPU's framebuffer. In which case, if GDI uses the framebuffer, I could grab the frame and have the GPU do the averaging massively parallel via CUDA, then send the returned color directly to the Arduino.


But that would depend strictly on if the windows GUI uses the framebuffer. (And perhaps how much initialization it would take to access it.)


#5068357 Why does a gameplay programmer need to know C++?

Posted by Dimension10 on 08 June 2013 - 09:43 PM

C++ may not be "required", but it's about as highly recommended as you get. Scripting languages have to run on top of some sort of interface, and that interface is usually programmed in a language like C++.


The point being: If you're a gameplay programmer, you'll probably be programming such interfaces, such as how UnrealScript translates to actual executable commands.


But if you know C#, C++ should be cake. The C languages are quite similar. And if a company is looking for C++ knowledge, I wouldn't count yourself out just because you only have C#. DirectX and OpenGL can use either.


But it would help you, overall, to get your feet wet in C++. Try the google channel "programminghelp.org". It's where I learned, and he's quite descriptive.

#5068290 Using the message loop in another source file?

Posted by Dimension10 on 08 June 2013 - 02:14 PM

So after learning a bit about DirectX, I understand that most of what goes on happens inside the message loop.



Is there any way to take everything inside the message loop and reference it to another file? I would rather not have all my game code crumpled up into one source file.



I tried creating a function, void Game(), which is called within the message loop. I declared it in a header file, and defined it in another source file that had the same #includes as the main source file. However, any of the creation, drawing, and present commands are unrecognized. I'm guessing it's referencing something within WinMain().


But the only immediate way I could see this being resolved is by including the main source file, which is a horrible idea. Either that, or inputting all the necessary functions as parameters.  (Which would either be tons of parameters, or a really large struct.)


But I see games and tutorials that are able to use a simple Game() function...





So if not, how can I do all my drawing somewhere BESIDES the main source? I would rather put the initialization as far behind me as possible.

#5068140 Just getting my hands dirty. Questions for starting out.

Posted by Dimension10 on 07 June 2013 - 07:25 PM

Okay, thanks. Initialization is the #1 part I'm afraid of. I'm watching John C Murphy's tutorials on YT, and it's an insane amount of stuff to remember. It seems like to be decently efficient at DX programming, you would need all of the initialization done in some sort of pre-made template, then access a "Game()" function of sorts to actually get the programming done. That way all of the actual game information can be consolidated elsewhere.


But the farther I go into this video, the less likely that seems possible.


Also, while the DX SDK is included with the Windows SDK, which is included with VS2012, it lacks the headers and library files needed for almost all of the tutorials online. Namely, d3dx11.h and DxErr.h. They are completely missing, so I had to download the SDK anyway.

#5068069 Just getting my hands dirty. Questions for starting out.

Posted by Dimension10 on 07 June 2013 - 01:56 PM

Hello all. I just now joined this site, and I had a few questions before I start getting my hands too dirty in game development.


(You can just skip over Goal and Knowledge. They're just there to give context.)





-I would like to design custom 3D engines, as well as GUI's to make game development more of a GUI experience. I used .werkkzeug for quite some time, and have become rather fond of the interface.


To me, creating my own sets of graphics methods is more interesting than the actual game development.




-I know a lot of the concepts already, such as rasterization, shaders, normal mapping, tesselation, deferred rendering, etc. I'm especially interested in Voxel-based Global Illumination. What I lack is the actual implementation.


-I've been spending the summer learning C++, including object-oriented programming.


-I have some math under my belt: Differential/Integral/Mulltivariable Calculus, Linear Algebra, and two semesters of Differential Equations.




Okay, so here are my questions:


1) Which would you recommend: DirectX or OpenGL? Which is generally easier to work with, and what are the differences?


2) I notice that DX projects have some brutal initialization. It looks like 20+ headers and sources just to make a window. I understand some of the stages, but is this normally all done manually, or is it more common to start off with a framework, and add in what you need?