• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Sixpack

DD surfaces... global or passed

7 posts in this topic

Most of the time I pass them globally. But now I'm working on an engine, and I want the user to be able to use as many surfaces as they want, so for that I have to pass them in the function.

But I don't think performance suffers that much when passing surfaces in a function (I know it does suffer some though).

0

Share this post


Link to post
Share on other sites
Someone correct me if am wrong but what is given to you by Direct Draw is a pointer rather than the actual surface itself. Hence if you pass the LPDIRECTDRAWSURFACE object to a function all you are really passing is the pointer, a simple 4 bytes, and not the entire surface. So I guess it would be a performance drain but only a nominal one.
0

Share this post


Link to post
Share on other sites
I guess what I was getting at was this:

Declare as global or in winmain (and thus pass into the game loop)?

Perhaps I didn't word it clearly enough.. still probably not . It was a question I've had for a couple months, and I finally got around to posting it--or what was left of it in my mind.

Six

0

Share this post


Link to post
Share on other sites
Personally I prefer the nice organization that a well thought out set of C++ classes offer as opposed to global data. IMHO, it makes it easier to program in the long run, especially as you're engine grows in complexity, and if done correctly you can limit performance hits from accessing encapsulated data.
0

Share this post


Link to post
Share on other sites
Sieggy,
Which leads me back to the original question; in a broader sense. Is your class declared globally or in main?

Six

0

Share this post


Link to post
Share on other sites
SixPack,

While most view it as a sacrilege, I suppose, I use a skeleton MFC structure. Now that preference aside, I have my major interfaces to Direct3D kept as members of my application's window class which is inherited from CFrameWindow. It handles all my major coordination of rendering. My application specific surfaces like my tiles and such are stored in classes that represent that object type. For instance CTile allows me to code behavior specific for that object type as well as provide access to its surface.
I probably dragged this out too much! If I was using winapi style code I probably would still do a similar construction as I described above: wrap my major interfaces and surfaces into a scene managment class stored in main and my other surfaces into classes that cooresponded to their object's function. I like the idea that a class can hold data, manipulate, and store it "behind the scene" so to speak, and the querying class does not have to know about what was going. You can't really guarantee this kind of relationship with global data so I avoid use of globals. Some poeple still aren't real big fanatics of the object oriented style but I think its incredibly powerfull, IMHO. I long answer, but does that answer you're question?

0

Share this post


Link to post
Share on other sites
ahhh... winmain or globally. I'd definately go with globally. I don't think I've seen a program yet that has declared direct draw variables in winmain. Well that's my recomendation!
0

Share this post


Link to post
Share on other sites
Just wanted to get your( guys/gals) feelings on this-

When using DirectDraw (whether it be encapsulated in a class or stand alone), do you pass the surfaces to functions or do you leave them as global variables?

I've seen this done both ways, but my feeling is that performance suffers when they are passed.

Six

0

Share this post


Link to post
Share on other sites