• 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.

Drizzt DoUrden

2D LoadBitmap through Header files??

5 posts in this topic

Can I make a header file, that calls to OpenGLs long LoadBitmap function, and then make my own function where I just pass params like filename ect, so that I just hae on line instead of a 100 line script to load an image??? This way, when I want to make image 1: myimagefunc(imagename, size, x, y, ect); then my image is loaded more cleanly? Or does someone have advice on a small script I can use? "I've sparred with creatures from the nine hells themselves... I barely plan on breaking a sweat here, today."~Drizzt Do'Urden Edited by - Drizzt DoUrden on August 22, 2001 10:33:07 PM Edited by - Drizzt DoUrden on August 22, 2001 10:47:00 PM Edited by - Drizzt DoUrden on August 22, 2001 10:47:41 PM
0

Share this post


Link to post
Share on other sites

Uh, can you say basic programming concept?

Declare the function in your .h file:


int MyImageFunc(char* imagename, int size, int x, int y);


Then define the function in your .c or .cpp file:


int MyImageFunc(char* imagename, int size, int x, int y)
{
// this is where you put your code to load an image
return return_code; // make sure you return a return code
}



0

Share this post


Link to post
Share on other sites
I kind of figured it would be something like that, but I was thinking to myself about the

BITMAPFILEHEADER and stuff like that, where would that go, the header file or the cpp file? Thats the part that confused me. or wich one would I write the ID in?

Instead of having to declare all of this, in my cpp file, i want it in my .h file and in my cpp file I can say. All right, i want to load my charecter GK into my game now. So, I need to load his bitmap.

void LoadIt(imageBitmap, location, ect);

and from there on I have the bitmap loaded into my game. And in the header file called messyopengl(or whatever) I have the big ,messy all capitolized script they want me to use.

I never tried to make my own header file and use it in my program before, thats why I am having this trouble.

"I''ve sparred with creatures from the nine hells themselves... I barely plan on breaking a sweat here, today."~Drizzt Do''Urden

Edited by - Drizzt DoUrden on August 22, 2001 11:21:08 PM
0

Share this post


Link to post
Share on other sites
You should put your function definition in the source file. And also, I would suggest that if you want your code organized that you keep it in multiple source files.
0

Share this post


Link to post
Share on other sites
I dont think I am saying this correctly:

I want to make a function that calls opengl functions.I want to declare the function with its normal params and ALL OF ITS INFO- in a header file. With this function , I want to be able to call many different bmps at different times. so the function is int loadIt:


include myHeaderFile
/// my player
loadIt(ID_Player, params needed to pass to create it through the more advanced function in the header file);

//later in my game, i find a need for an npc so:
loadIt(ID_NPC12202202, all the params needed);


now, i have my charecters created with a id to refer to.
So I can make a struct:

struct MainPlayer
{
str;
spd;
}ID_Player;

So there you have it. A fully loaded charecter with only 5 lines of code, compared to a 120 line code, that , I am sorry if I am wrong about this( I am just beggingintto tread the texture amppning chapter of this book)I have to write very time I have to load a bitmap. Do you have any idea how insane that is??? An rpg would require 20, 000 lines of code just to load charecters.


"I''''ve sparred with creatures from the nine hells themselves... I barely plan on breaking a sweat here, today."~Drizzt Do''''Urden
0

Share this post


Link to post
Share on other sites
bah. I figured it out. Thanks, your posts did help me, after I realized you made sense and I didnt. Lol. Thank you.


"I''''ve sparred with creatures from the nine hells themselves... I barely plan on breaking a sweat here, today."~Drizzt Do''''Urden
0

Share this post


Link to post
Share on other sites