I don't want to use my previous engine. it was this:
I want to be able to pick up and item when crossed, then use it or drop it later on.Code:int sword = 0;
if (sword == o)
this
else if (sword == 1)
that
How would i do that?
Printable View
I don't want to use my previous engine. it was this:
I want to be able to pick up and item when crossed, then use it or drop it later on.Code:int sword = 0;
if (sword == o)
this
else if (sword == 1)
that
How would i do that?
thats kind of vague, please elaborate.
you mean if u "step" on it?
well if thats what u meant, when i first started programming i had a text game, heres how i did it for picking up the amulet:
If you want to see all of the code just ask i'll post it as an attachment.Code:/***************************************************************
****************************************************************
Code for Amulet
****************************************************************
***************************************************************/
if (User_Location_X == 0 && User_Location_Y == 5)
{
if (Amulet == 1)
{
cout <<"You have returned to where you found Soris's Amulet.\n\n";
}
else if (Amulet == 0)
{
cout <<"You found Soris's Amulet!\n\n";
cout <<"You feel protected and are awarded ten points.\n\n";
Amulet = 1;
}
}
Here are some of the data structures I've used for text games
PHP Code:
enum eItemFunction { eOnce, eInfinite, eFinite, eTimeLimited }; // how many times can you use item?
enum eRoomType { ePath, eWall, eRoom }; // types of rooms
struct sItem {
char* itemName;
int itemStrBonus;
int itemLifeBonus;
eItemFunction itemUse;
}
struct sMapRoom {
eRoomType roomType;
sItem roomItems[4]; // max of 4 items
char* roomDescription;
bool bNeedKey;
char* keyName;
}
struct sMap {
sMapRoom mapRooms[100][100];
char* mapDescription;
// map details like geography etc.
}
struct sPlayer {
sItem Inventory[32];
int Life;
int x; // map co-ordinates
int y;
// etc.
}
That helps out a little... but how would i ADD the items to the inventory? My first game was using RoDs engine. i created about 1800 lines of that crap.... and the game was really bad. after 6 games of that i got into using structures... my latest source is this
attached. Its a game to rival my dads Beave hunter (beave is my nickname). So It's called Dad Hunter. LOL. But when i start the game, im already on that wierd floor with the trap on it.. no matter what, then when i add to the skill, max_y etc, it performs an illegal operation. That really irritates me.
Hm, wha? where? huh? RoD made an engine? Tell me about it!Quote:
Originally posted by Blizzarddog
My first game was using RoDs engine.
Dad Hunter makes me think of my time in BASIC :p
You should do something about it, put some things in functions.
it was in my first week of C++, i had a junky-at-best txt game that ran on if's, a switch or two, and user input...i mean it was ok but i wouldn't consider it an engine...
I love Cut & PasteQuote:
My first game was using RoDs engine and the game was really bad.
:D
I call anything that the game runs on an engine, what makes things happen. In my experiance in ZZT, my company made a game call mech trainer with the player at the bottom of the screen controlling the mech above him. That is an engine. If (sword == 2) do this, i consider that an engine because else if (sword == 1) do that
if its an engine its a ford....prone to problems....
And travis, dont call me cut & paste, my dad does that to me when i wrote 3400 lines of C++ code by myself.. and it made me destroy alot of stuff... almost made me break the computer.. so DONT call me that.
And i dont care much for sarcaasm.. bad week.
I hear ya.Quote:
Originally posted by RoD
if its an engine its a ford....prone to problems....
Hmmmmm, it was a joke for RoD, anyhow sorryZ.Quote:
Originally posted by Blizzarddog
And travis, dont call me cut & paste, my dad does that to me when i wrote 3400 lines of C++ code by myself.. and it made me destroy alot of stuff... almost made me break the computer.. so DONT call me that.
And i dont care much for sarcaasm.. bad week.
i got the joke, guess he missed it...
Okay... but my other nickname is some how CNP... Cut 'n Paste because i was to busy to answer my dad when he asked me what && is, what cpp programmer doesn't know what && is?
I kinda like the idea of writing an Engine for ungifted c++
programmers. Is there much need for a Console App Engine?
A beginning one?Quote:
Originally posted by Blizzarddog
what cpp programmer doesn't know what && is?
Nah, a dos engine is fairly simple. It needs a coord system, etc. Gimme your email and i'll send you mine if you want.
I knew what it was when i first picked up a cpp book when i was 13, about 1/5 year ago. And i need it so that i can actually start a real game... I dont know any thing about the windows programming.
If your serious about game programming, you should learn opengl or directx....at first i didn't know any winapi, and it was really confusing and intimidating as to where and when to start, been i've been in opengl for a few weeks now, and i'm getting prepared to build a game engine and do my first FPS, ever. Dive in, the water will be warm soon enough!
Hey rod, your not talking about your Caverns game, are you?
the one like this:
Code:
cin >> name; /* Store users name*/
cout <<"Hello "<< name <<" , do u think you can escape the caverns?\n\n";
cout <<"Your objective is to stay alive and aquire 100 points.\n\n";
cout <<"Both of these tasks are possible, and with a little ";
cout <<"logic u will succeed.\n\n";
cout <<"You may see controls at any time by pressing (I)\n\n";
getch(); /* Wait for key push and continue.*/
do/* Start loop*/
{
/* Check user position.*/
if (User_Location_Y == 25)
{
cout <<"You cannot continue in this direction\n";
User_Location_Y--;
getch();
}
else if (User_Location_Y == -25)
{
cout <<"You cannot continue in this direction\n";
User_Location_Y++;
getch();
}
else if (User_Location_X == 25)
{
cout <<"You cannot continue in this direction\n";
User_Location_X--;
getch();
}
else if (User_Location_X == -25)
{
cout <<"You cannot continue in this direction\n";
User_Location_X++;
}
/* This decrements by 1 every loop, when it hits 0 game ends.*/
end_game--;
if (end_game == 0)
{
system("cls");
cout <<"You have used all your energy, GAME OVER!\n";
return 0;
}
/* This displays every loop.*/
system("cls");
cout <<"North (1)\nSouth (2)\nEast (3)\nWest (4)\n\n";
cin >>input;
cout <<"\n";
/* Key for user initiated exit.*/
if (input == 'Q' || input == 'q')
{
system("cls");
return 0;
}
not in my last post no. What you have there is my really, really old engine, i improved some stuff since then but caverns is an abandoned newbie project.
I'm talking bout a 3d opengl graphics engine that my FPS (and prolly a few others as i improve) will be based off.
when I start a windows project a window looks like this:
where exactly do i use textout and stuff?Code:#include <windows.h>
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure(HWND, UINT, WPARAM, LPARAM);
/* Make the class name into a global variable */
char szClassName[ ] = "WindowsApp";
int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The Window structure */
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof(WNDCLASSEX);
/* Use default icon and mouse-pointer */
wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor(NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use light-gray as the background of the window */
wincl.hbrBackground = (HBRUSH) GetStockObject(LTGRAY_BRUSH);
/* Register the window class, if fail quit the program */
if(!RegisterClassEx(&wincl)) return 0;
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx(
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Windows App", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
544, /* The programs width */
375, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
/* Make the window visible on the screen */
ShowWindow(hwnd, nFunsterStil);
/* Run the message loop. It will run until GetMessage( ) returns 0 */
while(GetMessage(&messages, NULL, 0, 0))
{
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
}
/* The program return-value is 0 - The value that PostQuitMessage( ) gave */
return messages.wParam;
}
/* This function is called by the Windows function DispatchMessage( ) */
LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_DESTROY:
PostQuitMessage(0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc(hwnd, message, wParam, lParam);
}
return 0;
}
Run this:
Code:/* Steven Billington
*/
/* Here we set the libraries to be used in the program, and
trim some of the excess off of windows
*/
#define WIN32_LEAN_AND_MEAN
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")
#pragma comment(lib, "glaux.lib")
/* Include all needed headers for the project. Windows brings in
everything needed for the basic application, and the other three
bring in OpenGL related functions.
*/
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glaux.h>
/* These are our global variables. These are ok in this program,
but i wouldn't reccomend making a habit out of using global
variables.
angle: Holds current angle of rotating triangle
g_HDC: Global Device Context
*/
float angle = 0.0f;
HDC g_HDC;
/* Function: SetupPixelFormat
Purpose: This function gets the setup for the pixel format,
go figure right?
*/
void SetupPixelFormat(HDC hDC)
{
int nPixelFormat; /* Pixel format index*/
static PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), //size of structure
1, //version, always set to one
PFD_DRAW_TO_WINDOW | //support window
PFD_SUPPORT_OPENGL | //support opengl
PFD_DOUBLEBUFFER, //support double buffering
PFD_TYPE_RGBA, //RGBA color mode
32, //32bit color mode
0,0,0,0,0,0, //ignore color bits, not used
0, //no alpha buffer
0, //ignore shift bit
0, //no accumulation buffer
0,0,0,0, //ignore accumulation buffers
16, //16 bit zbuffer size
0, //no stencil buffer
0, //no auxiliary buffer
PFD_MAIN_PLANE, //main drawing plane
0, //reserved
0,0,0 }; //layer masks ignored
/* Choose best matching pixel format, return index*/
nPixelFormat = ChoosePixelFormat(hDC,&pfd);
/* Set pixel format to device context*/
SetPixelFormat(hDC,nPixelFormat,&pfd);
}
/* Function: WndProc
Purpose: This is our Windows Procedure Event Handler
*/
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static HGLRC hRC; //rendering context
static HDC hDC; //device context
char string[] = "Hello World!"; //display text
int width, height; //window width, height
switch(message)
{
case WM_CREATE: //window is being created
hDC = GetDC(hwnd); //get current windows device context
g_HDC = hDC;
SetupPixelFormat(hDC); //call your pixel format setup function
//create rendering context and make it current
hRC = wglCreateContext(hDC);
wglMakeCurrent(hDC,hRC);
return 0;
break;
case WM_CLOSE: //window is closing
//deselect rendering context and delete it
wglMakeCurrent(hDC,NULL);
wglDeleteContext(hRC);
//send WM_QUIT to messagr queue
PostQuitMessage(0);
return 0;
break;
case WM_SIZE:
height = HIWORD(lParam); //get height and width
width = LOWORD(lParam);
if (height == 0) //don't want a divide by 0
{
height = 1;
}
//reset the viewport to new dimensions
glViewport(0,0,width,height);
glMatrixMode(GL_PROJECTION); //set projection matrix
glLoadIdentity(); //reset proj matrix
//calculate aspect ratio of window
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,1.0f,1000.0f);
glMatrixMode(GL_MODELVIEW); //set modelview matrix
glLoadIdentity(); //reset mdeolv matrix
return 0;
break;
default:
break;
}
return (DefWindowProc(hwnd,message,wParam,lParam));
}
/* Function: WinMain
Purpose: Do i need to state this? Ok, its the main function.
*/
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
WNDCLASSEX windowClass; //window class
HWND hwnd; //window handle
MSG msg; //message
bool done; //flag saying when app is complete
/* Fill out the window class structure*/
windowClass.cbSize = sizeof(WNDCLASSEX);
windowClass.style = CS_HREDRAW | CS_VREDRAW;
windowClass.lpfnWndProc = WndProc;
windowClass.cbClsExtra = 0;
windowClass.cbWndExtra = 0;
windowClass.hInstance = hInstance;
windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
windowClass.hCursor = LoadCursor(NULL, IDC_ARROW);
windowClass.hbrBackground = NULL;
windowClass.lpszMenuName = NULL;
windowClass.lpszClassName = "MyClass";
windowClass.hIconSm = LoadIcon(NULL, IDI_WINLOGO);
/* Register window class*/
if (!RegisterClassEx(&windowClass))
{
return 0;
}
/* Class registerd, so now create window*/
hwnd = CreateWindowEx(NULL, //extended style
"MyClass", //class name
"A Real OGL Win App", //app name
WS_OVERLAPPEDWINDOW | //window style
WS_VISIBLE |
WS_SYSMENU |
WS_CLIPCHILDREN |
WS_CLIPSIBLINGS,
100,100, //x/y coords
400,400, //width,height
NULL, //handle to parent
NULL, //handle to menu
hInstance, //application instance
NULL); //no extra parameter's
/* Check if window creation failed*/
if (!hwnd)
{
return 0;
}
ShowWindow(hwnd,SW_SHOW); //displays window
UpdateWindow(hwnd); //update window
done = false; //inititalize condition variable
//main message loop
while(!done)
{
PeekMessage(&msg,hwnd,NULL,NULL,PM_REMOVE);
if (msg.message == WM_QUIT)
{
done = true;
}
else
{
//do rendering here
//clear screen and depth buffer
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity(); //reset modelview matrix
angle = angle + 0.1f; //increase rotation angle counter
if (angle >= 360.0f) //reset angle counter
{
angle = 0.0f;
}
glTranslatef(0.0f,0.0f,-5.0f); //move back 5 units
glRotatef(angle,0.0f,0.0f,1.0f); //rotate along z-axis
glColor3f(1.0,0.0f,0.0f); //set color to red
glBegin(GL_TRIANGLES); //draw the triangle
glVertex3f(0.0f,1.0f,0.0f);
glVertex3f(0.0f,0.0f,0.0f);
glVertex3f(1.0f,0.0f,0.0f);
glEnd();
SwapBuffers(g_HDC); //bring back buffer to foreground
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return msg.wParam;;
}
I was talking about the text game you were gonna send me in the email.
i was going to send it to trav he asked what was involved in it, but ya thats the really old version.
my dev c++ has an error in it.. it always gets a error in the resource file when i try to do a project... can i do that just by using a regular C++ file?
it should compile fine, make sure you have those three opengl libraries installed on your computer. If not you can get them at www.opengl.org
Nah, not really required, i'm going to write my own OpenGLQuote:
Originally posted by RoD
Nah, a dos engine is fairly simple. It needs a coord system, etc. Gimme your email and i'll send you mine if you want.
Engine soon and i know what's involved.
I got these errors:
*EDIT*PHP Code:
157 c:/mydocu~1/c__~1/test.cpp
(Each undeclared identifier is reported only
158 c:/mydocu~1/c__~1/test.cpp
`MSGmsg' undeclared (first use this function)
158 c:/mydocu~1/c__~1/test.cpp
`MSGmsg' undeclared (first use this function)
158 c:/mydocu~1/c__~1/test.cpp
`MSGmsg' undeclared (first use this function)
158 c:/mydocu~1/c__~1/test.cpp
`MSGmsg' undeclared (first use this function)
158 c:/mydocu~1/c__~1/test.cpp
`MSGmsg' undeclared (first use this function)
206 c:/mydocu~1/c__~1/test.cpp
`done' undeclared (first use this function)
206 c:/mydocu~1/c__~1/test.cpp
`done' undeclared (first use this function)
I used PHP tags so its easier to read
Runs spotless on my compiler.Quote:
Originally posted by Blizzarddog
I got these errors:
*EDIT*PHP Code:
157 c:/mydocu~1/c__~1/test.cpp
(Each undeclared identifier is reported only
158 c:/mydocu~1/c__~1/test.cpp
`MSGmsg' undeclared (first use this function)
158 c:/mydocu~1/c__~1/test.cpp
`MSGmsg' undeclared (first use this function)
158 c:/mydocu~1/c__~1/test.cpp
`MSGmsg' undeclared (first use this function)
158 c:/mydocu~1/c__~1/test.cpp
`MSGmsg' undeclared (first use this function)
158 c:/mydocu~1/c__~1/test.cpp
`MSGmsg' undeclared (first use this function)
206 c:/mydocu~1/c__~1/test.cpp
`done' undeclared (first use this function)
206 c:/mydocu~1/c__~1/test.cpp
`done' undeclared (first use this function)
I used PHP tags so its easier to read
Well, thats in a console app, otherwise, theres an error inthe resource file
Hoo, wait up, what are you trying to compile? Post code plz.
that thing that RoD posted
^ This? What kind of project are you running it in then?Code:/* Steven Billington
*/
/* Here we set the libraries to be used in the program, and
trim some of the excess off of windows
*/
#define WIN32_LEAN_AND_MEAN
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")
#pragma comment(lib, "glaux.lib")
/* Include all needed headers for the project. Windows brings in
everything needed for the basic application, and the other three
bring in OpenGL related functions.
*/
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glaux.h>
/* These are our global variables. These are ok in this program,
but i wouldn't reccomend making a habit out of using global
variables.
angle: Holds current angle of rotating triangle
g_HDC: Global Device Context
*/
float angle = 0.0f;
HDC g_HDC;
/* Function: SetupPixelFormat
Purpose: This function gets the setup for the pixel format,
go figure right?
*/
void SetupPixelFormat(HDC hDC)
{
int nPixelFormat; /* Pixel format index*/
static PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), //size of structure
1, //version, always set to one
PFD_DRAW_TO_WINDOW | //support window
PFD_SUPPORT_OPENGL | //support opengl
PFD_DOUBLEBUFFER, //support double buffering
PFD_TYPE_RGBA, //RGBA color mode
32, //32bit color mode
0,0,0,0,0,0, //ignore color bits, not used
0, //no alpha buffer
0, //ignore shift bit
0, //no accumulation buffer
0,0,0,0, //ignore accumulation buffers
16, //16 bit zbuffer size
0, //no stencil buffer
0, //no auxiliary buffer
PFD_MAIN_PLANE, //main drawing plane
0, //reserved
0,0,0 }; //layer masks ignored
/* Choose best matching pixel format, return index*/
nPixelFormat = ChoosePixelFormat(hDC,&pfd);
/* Set pixel format to device context*/
SetPixelFormat(hDC,nPixelFormat,&pfd);
}
/* Function: WndProc
Purpose: This is our Windows Procedure Event Handler
*/
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static HGLRC hRC; //rendering context
static HDC hDC; //device context
char string[] = "Hello World!"; //display text
int width, height; //window width, height
switch(message)
{
case WM_CREATE: //window is being created
hDC = GetDC(hwnd); //get current windows device context
g_HDC = hDC;
SetupPixelFormat(hDC); //call your pixel format setup function
//create rendering context and make it current
hRC = wglCreateContext(hDC);
wglMakeCurrent(hDC,hRC);
return 0;
break;
case WM_CLOSE: //window is closing
//deselect rendering context and delete it
wglMakeCurrent(hDC,NULL);
wglDeleteContext(hRC);
//send WM_QUIT to messagr queue
PostQuitMessage(0);
return 0;
break;
case WM_SIZE:
height = HIWORD(lParam); //get height and width
width = LOWORD(lParam);
if (height == 0) //don't want a divide by 0
{
height = 1;
}
//reset the viewport to new dimensions
glViewport(0,0,width,height);
glMatrixMode(GL_PROJECTION); //set projection matrix
glLoadIdentity(); //reset proj matrix
//calculate aspect ratio of window
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,1.0f,1000.0f);
glMatrixMode(GL_MODELVIEW); //set modelview matrix
glLoadIdentity(); //reset mdeolv matrix
return 0;
break;
default:
break;
}
return (DefWindowProc(hwnd,message,wParam,lParam));
}
/* Function: WinMain
Purpose: Do i need to state this? Ok, its the main function.
*/
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
WNDCLASSEX windowClass; //window class
HWND hwnd; //window handle
MSG msg; //message
bool done; //flag saying when app is complete
/* Fill out the window class structure*/
windowClass.cbSize = sizeof(WNDCLASSEX);
windowClass.style = CS_HREDRAW | CS_VREDRAW;
windowClass.lpfnWndProc = WndProc;
windowClass.cbClsExtra = 0;
windowClass.cbWndExtra = 0;
windowClass.hInstance = hInstance;
windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
windowClass.hCursor = LoadCursor(NULL, IDC_ARROW);
windowClass.hbrBackground = NULL;
windowClass.lpszMenuName = NULL;
windowClass.lpszClassName = "MyClass";
windowClass.hIconSm = LoadIcon(NULL, IDI_WINLOGO);
/* Register window class*/
if (!RegisterClassEx(&windowClass))
{
return 0;
}
/* Class registerd, so now create window*/
hwnd = CreateWindowEx(NULL, //extended style
"MyClass", //class name
"A Real OGL Win App", //app name
WS_OVERLAPPEDWINDOW | //window style
WS_VISIBLE |
WS_SYSMENU |
WS_CLIPCHILDREN |
WS_CLIPSIBLINGS,
100,100, //x/y coords
400,400, //width,height
NULL, //handle to parent
NULL, //handle to menu
hInstance, //application instance
NULL); //no extra parameter's
/* Check if window creation failed*/
if (!hwnd)
{
return 0;
}
ShowWindow(hwnd,SW_SHOW); //displays window
UpdateWindow(hwnd); //update window
done = false; //inititalize condition variable
//main message loop
while(!done)
{
PeekMessage(&msg,hwnd,NULL,NULL,PM_REMOVE);
if (msg.message == WM_QUIT)
{
done = true;
}
else
{
//do rendering here
//clear screen and depth buffer
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity(); //reset modelview matrix
angle = angle + 0.1f; //increase rotation angle counter
if (angle >= 360.0f) //reset angle counter
{
angle = 0.0f;
}
glTranslatef(0.0f,0.0f,-5.0f); //move back 5 units
glRotatef(angle,0.0f,0.0f,1.0f); //rotate along z-axis
glColor3f(1.0,0.0f,0.0f); //set color to red
glBegin(GL_TRIANGLES); //draw the triangle
glVertex3f(0.0f,1.0f,0.0f);
glVertex3f(0.0f,0.0f,0.0f);
glVertex3f(1.0f,0.0f,0.0f);
glEnd();
SwapBuffers(g_HDC); //bring back buffer to foreground
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return msg.wParam;;
}
In a dev C++ wiindows app
And what the f is pragma?
Then i don't understand much of the errors, you have all the
headers and libs? Check it in the dir
I copied it
#Pragma's are compiler directive's.
I'm not sure about if you can compile OpenGL programs under
DEV++. I suggest look at the DEV forums.
I've done it before, Dev came with those type of programs
Do keep in mind that the program RoD posted is developed
for a specific compiler, probably the one he has, and might
not work with DEV, ask RoD his compiler
Yea, okay.. are you on 24/7, travis?
Nearly:pQuote:
Originally posted by Blizzarddog
are you on 24/7, travis?
LOL Whats your best program/game?
Hm, well i haven't made any games\programs, only test things.Quote:
Originally posted by Blizzarddog
LOL Whats your best program/game?
But i plan to do a nice 3D game using OpenGL soon....
Oh... how much C++ do you know??
Quite some bit, but i haven't done much on the advancedQuote:
Originally posted by Blizzarddog
Oh... how much C++ do you know??
aspects simply because i don't need them yet. I'm focussing on
Game Programming wich, at the state i'm right now, doesn't
require Polymorphism or Abstraction. I will get into it
as soon as it will be required.
Uh-huh
I'm imagening a drooling person with a dumb look on his face,Quote:
Originally posted by Blizzarddog
Uh-huh
How come?;)
uhm *Sucks up some slobber* i dont know.. lol. I make programs.. i created several non-useful databases.. you know, dog breed, dog flea count, dog weight. *Slaps dumb look off face*
Sounds like a struct...Quote:
Originally posted by Blizzarddog
dog breed, dog flea count, dog weight.
Yahoo, i'm now officially a Blizzarddog qualified programmer!Code:typedef struct dog
{
string breed;
int flea_count;
int dog_weight;
}
Okay, yea i use structs, i cant do classes...... But i do need to learnd indows API, even my MSVC++ Doesn't compile copied programs... whats wrong!?!?!?
Congrats! You just qualified to thread bumper!:D :p
Post the not-running code.
Hey, i just saw your post from a while back and replied.... I need the info!
Something with the closing '}'Code:#include <windows.h>
#include <tchar.h>
#include "resource.h"
BOOL MainDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
return FALSE;
}
int _tmain(void)
{
DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG1),
NULL, (DLGPROC)MainDialogProc, 0);
return 0;
}
What the hell? This code won't run in a hundred years!
PS: Nowhere a wrong '{' or '}' to be seen.
Oh yea, if thats your lame attempt a a joke...... You should try MSCV++ MSDN Library insults... not Human...
Whats wrong with it? I copied it from www.sunlight.org or .com or what ever it is..... lemme think....... oh yeah its http://sunlightd.com/Windows/GUI/DialogBoxes.html
It said in MSVC++, start a new WIN32 App, and it will compile, i have the headers and every thing.
Yeah, You posted only the first part of the code on the firstQuote:
Originally posted by Blizzarddog
Whats wrong with it? I copied it from www.sunlight.org or .com or what ever it is..... lemme think....... oh yeah its http://sunlightd.com/Windows/GUI/DialogBoxes.html
It said in MSVC++, start a new WIN32 App, and it will compile, i have the headers and every thing.
page:D . What joke do you mean BTW?
andQuote:
Originally posted by Travis Dane
Congrats! You just qualified to thread bumper!:D :p
those ones. That doesn't help me much, as structs are very easy to use..... I can't even do classes!Quote:
Originally posted by Travis Dane
Yahoo, i'm now officially a Blizzarddog qualified programmer!
And Hunter2's code doesn't run, either....