Holland

Member
  • Content count

    95
  • Joined

  • Last visited

Community Reputation

155 Neutral

About Holland

  • Rank
    Member
  1. Singleton pattern abuse

    I use singletons in my game. Not many, but I use them. DebugLogger is a singleton class I have. Every method is protected against multiple threads, and it CAN slow down my performance. Haven't seen it yet, but I know the chance is there. This is only available in debug and debug/release builds of the game. In release, it's not active and doesn't do anything. It's scenarios like this (and I honestly can't think of another scenario) that are okay to be a singleton. EVERYTHING will need to log something, and you don't want to pass around a pointer/reference to the logger to everything. Now, what I do with things I know I only need 1 of, but I don't want to make a singleton? They get held on to by some other object. My RenderSystem class (hands loading and storing textures, animations, models, etc.) is what holds on to the Renderer class. Renderer is something I should only have 1 of... [source lang="cpp"]public abstract class AllocateOne { private static int mAllocations = 0; public AllocateOne() { if (++mAllocations > 1) { // assert, exception, log, something to let you know... } } public ~AllocateOne() { --mAllocations; } }[/source] I use something like this, and inherit whatever class from it. And, again, I'd only do something like this in debug or debug/release....the final build of your game shouldn't need this type of protection because it should just work. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
  2. 3 questions...but first, here's my setup My activity class: [CODE] ...useless stuff... import android.opengl.GLSurfaceView; public class MyApp extends Activity { private GLSurfaceView mSurfaceView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); //fullscreen getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); glSurfaceView = new GLSurfaceView(this); glSurfaceView.setRenderer(new MyRenderer()); setContentView(glSurfaceView); } } [/CODE] My Renderer class [CODE] ...unimportant stuff... import android.opengl.GLSurfaceView.Renderer; public class MyRenderer implements Renderer { @Override public void onDrawFrame(GL10 gl) { ...iterate over draw objects and call .draw() on them... } } ...more unimportant stuff... [/CODE] 1) Is OpenGL ES double buffered by default? Right now, I've created a Renderer class that extends GLSurfaceView.Renderer. From that, I've got an override for onDrawFrame...like you can see above. Is this already double buffered? I've done a little bit of OpenGL coding for PC and I remember having to specifically tell it to swap buffers... 2) Given my current setup, is the renderer already on its own thread? Is that something handled by OpenGL ES (or the GLViewPort class)? 3) Right now I'm doing everything inside of the onDrawScene(GL10 gl) function. Is there a better way of creating a game loop? Seems like (assuming rendering is currently on its own thread), onDrawScene should just iterate of my drawable objects and draw them, but I should probably have a loop in another thread somewhere polling input, updating drawable object positions, etc. Any thoughts? Thanks, in advance, for the help! [Edit: spelling error]
  3. Objective C book

    Awesome...thanks. I've also heard of others referring to this book so it seems to have a reputation of sorts. [quote name='blewisjr' timestamp='1311290009' post='4838693'] [quote name='Holland' timestamp='1311288777' post='4838687'] Looking for recommendations on books (physical, actual books...not web sites please) that are based around Objective C programming for the already experience C/C++/C# programmer. All of the books I've found on Amazon are for people who have never programmed before. I have programmed for a number of years, in the gaming industry. I just want a nice book to use as reference and to get me started with Objective C goodness. Any suggestions? Thanks! [/quote] You are going to need a bit more then a reference. Objective-C is a few worlds apart from the other languages you know because it revolves around Apples Cocoa framework which is what actually makes objective-c useful. I would recommend the Hillegass book from this link. [url="http://www.amazon.com/Cocoa-Programming-Mac-OS-3rd/dp/0321503619"]http://www.amazon.co...d/dp/0321503619[/url]. This is not what I would consider a noob book it is organized in such a way that you can skip or just quick review certain earlier sections. For instance you can skip or skim the first section on pure C and move right to the objective C portion and then right into the Cocoa portion. This is the best book on the market by far and Objective-C/Cocoa are so wacked that this book will make sense of it. [/quote]
  4. Looking for recommendations on books (physical, actual books...not web sites please) that are based around Objective C programming for the already experience C/C++/C# programmer. All of the books I've found on Amazon are for people who have never programmed before. I have programmed for a number of years, in the gaming industry. I just want a nice book to use as reference and to get me started with Objective C goodness. Any suggestions? Thanks!
  5. [quote name='Washu' timestamp='1297836880' post='4774840'] I doubt you'll find one. The principles and concepts of stackless are fairly simple, and the rest is really just getting a handle on python. Of which there are several free e-books if I recall correctly. Other than that, reading the newsgroup/discussion groups for stackless and following the examples is the best way to get a handle on it. [/quote] Hmm..I guess I'll just grab a couple books on Python in general then. Like I said before, I'm pretty old school when it comes to reference material. I'd prefer actual books over ebooks or online resources. Thanks!
  6. Thanks blewisjr. I know stackless is just a subset of Python. I don't need a book specifically about stackless python, but a good book for advanced programmers that covers stackless to some extent would be great.
  7. Just to clarify, I don't want websites, python docs, or tutorials. I can find all of that on my own. I'm a more-than-capable googler. What I'm interested in is a book, or books, with good coding strategies and general knowledge relating directly to stackless python. I've worked in the gaming industry as a programmer for long enough to understand basic coding practices and I'm very familiar with C++ and C#. The company I work for is about to switch over to stackless python for certain things, and I want to learn as much as I can. I'm old school and like real actual books. I'm definitely not looking for a book that starts with "How to write a 'Hello World!' application." Any help would be greatly appreciated! Thanks.
  8. Game Dev for Android

    http://lmgtfy.com/?q=free+textures
  9. intermediate worker server?

    awesome...thank you. i did a lot of digging on the subject once you told me the technical name. i definitely want this to run in C++, mostly because it's a language i'm most familiar with and because i have libraries and a codebase that i already have written...and want to use. so my next question is: What's the best route to take if I want a C++ based application server? I would also like it accessible from any platform (without me having to write a library or some code-set to make it connect in each platform). If this means I send it an HTTP request and it sends back an XML page, I don't care. I just want this to be easily accessible with basic libraries that every platform and every language has by default (within reason...i don't need it to be accessible from a pascal app or anything...lol) Thanks again!
  10. I was hoping someone could give me some insight. I'd like to create some sort of an intermediate server which i could connect to and make calls to. This server should be able to make sql querys and compute data and return some sort of result. I was wanting this so that I could have a cross-platform solution to interacting with a database for a game or program where online data would need to be stored. I don't want to have to implement all of these calculations in every version of the game client when the server should be doing them anyway. I'm assuming I'll need to call the functions with an HTTP call or something like that, but I don't really know. Is there something out there like this? Or a tutorial on how to create your own? for windows or linux computer...doesn't matter to me. thanks!
  11. [.net] file progress popup?

    where are all of these animations? I have VS2008 Pro so I should have them but I don't see them anywhere. Thanks.
  12. I'm looking for a simple way to have a file progress window pop up. One of the kind where it shows a file flying from one file to another or something like that. The idea is that I have a function that is going to take some time to execute because it has to access a sql database and run a few querys on that at the beginning of the function i'd like to be able to pop up a progress window that animates, showing that something is going on. and then at the end of the function when it's all done i would like to close the dialog thanks in advance!
  13. Does DataTable.ImportRow() take into account duplicates? In other words, if I try and import and exact duplicate row, will it import it anyways, or will it not since there is already a duplicate in there? bool isActive; // true if the "Active Only" checkbox is checked bool isValid; // true if the "Valid Only" checkbox is checked DataTable mainTable = GetMainTable(); DataTable newTable = mainTable.Clone(); if (isValid) { DataRow[] rows = mainTable.Select("isValid = true"); foreach (DataRow r in rows) { newTable.ImportRow(r); } } if (isActive) { DataRow[] rows = mainTable.Select("startDate <= '" + DateTime.Now.ToShortDateString() + "' AND finishDate >= '" + DateTime.Now.ToShortDateString() + "'") foreach (DataRow r in rows) { newTable.ImportRow(r); } } There might be some rows that would be active AND valid, and thus those rows would be imported in duplicate. But will ImportRow() catch this or not?
  14. Quote:Original post by Codeka Quote:Original post by Holland and even though myDataTable might have 22 columns, it will only display the columns with the heading "id", "firstName", "lastName"? If that is the case then that is EXACTLY what i need. :)Yes, except you add BoundColumn objects to the Columns property, like so: *** Source Snippet Removed *** The first parameter to the constructor is the name of the column in the DataTable, and the second parameter is the actual column heading to use. Are you sure about the BoundColumn? I added the reference to System.Web and an using System.Web.UI.WebControls. I have the same line of code like you show: DataGrid.Columns.Add(new BoundColumn("id", "Ident")); but it says BoundColumn does not have a constructor that takes 2 params.
  15. Quote:Original post by Codeka Quote:Original post by Holland The benefits is because right now I want to just display certain columns in a DataGrid, but I don't want to lose all of the information in my main table. And on the same token, setting a DataGrid to just display an entire DataTable is a simple assignment operator to a property of the DataGrid. So I don't want to have to go through and insert columns and rows into the DataGrid.If that's all you want to do, then you just have to set the AutoGenerateColumns to false and populate the Columns yourself, then bind your DataTable as normal. In fact, if you're adding your DataGrid in the aspx/ascx file, you can use markup to define the column with ease. That's gotta be much simpler than cloning the whole DataTable and removing columns. Hmm...so I can just do: DataGrid.AutoGenerateColumns = false; DataGrid.Columns.Add(new DataColumn("id", typeof(Int32))); DataGrid.Columns.Add(new DataColumn("firstName", typeof(string))); DataGrid.Columns.Add(new DataColumn("lastName", typeof(string))); DataGrid.DataSource = myDataTable; and even though myDataTable might have 22 columns, it will only display the columns with the heading "id", "firstName", "lastName"? If that is the case then that is EXACTLY what i need. :)