49,761 Topics

Member Avatar for
Member Avatar for hwoarang69

hi, i just started learing 2d game programming. so far i can make my character go right, left and check for collisions. But i cant find out how to make him jump. any thing will be helpfull. i now i will have something like while (LoopGDK()) if(dbUpKey() == 1) { …

0
64
Member Avatar for tomtetlaw

Are there any libraries out there that allow me to play .avi files within my OpenGL application?

Member Avatar for tomtetlaw
0
139
Member Avatar for Sunshine2011

#include <iostream> #include <vector> #include <iterator> using namespace std; class members { private: int Age; int Money; public: void setAge(int age) {Age=age;} void setMoney(int money) {Money=money;} int getAge()const {return Age;} int getMoney()const {return Money;} members(int age=0,int money=0): Age(age),Money(money) {} }; int main() { vector<members>v_members; for(size_t i=0,z=0;i<10;++i,++z) { if(z!=5) { v_members.push_back(members(50,70)); …

Member Avatar for Sunshine2011
0
230
Member Avatar for hwoarang69

so this program is really simply. my player(ch1,bmp) just move right and left. on my map there are wall and coin. if player hit a wall it should stop. but if it hit a coin, coin should get delete. problem iam having is that for some reason player(ch.bmp) is display …

0
65
Member Avatar for MasterHacker110

When i compile my code with visual studio 2010 express i get the following errors: 'Client.exe': Unloaded 'C:\Windows\SysWOW64\WSHTCPIP.DLL' And with the other program i get these: 'Server.exe': Loaded 'C:\Users\User\Desktop\Server\Debug\Server.exe', Symbols loaded. 'Server.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file 'Server.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB …

0
75
Member Avatar for Sendy Hipo

Hello, im a bit new to c++ and learning in my own, but im stuck to a problem. Im trying to do a practice converting string/c-string to int : Sum of Digits in a String Write a program that asks the user to enter a series of single digit numbers …

Member Avatar for Sendy Hipo
0
545
Member Avatar for Hafte201

#include<GL/glut.h> #include<Math.h> #include<iostream> using namespace std; int direction=0; void drawRectangle(GLfloat x1,GLfloat y1,GLfloat x2,GLfloat y2) { glBegin(GL_LINES); glVertex2f(x1,y1); glVertex2f(x1,y2); glVertex2f(x1,y1); glVertex2f(x2,y1); glVertex2f(x2,y1); glVertex2f(x2,y2); glVertex2f(x1,y2); glVertex2f(x2,y2); glEnd(); } void drawQuadrants() { glLoadIdentity(); glBegin(GL_LINES); glVertex2f(0.0,-1.0); glVertex2f(0.0,1.0); glVertex2f(-1.0,0.0); glVertex2f(1.0,0.0); glEnd(); } void display() { glPushMatrix(); glLoadIdentity(); glClearColor(0.0f,0.0f,0.0f,0.0f); glClear(GL_COLOR_BUFFER_BIT); glDisable(GL_DEPTH_TEST); glColor3f(1.0f,1.0f,1.0f); drawQuadrants(); glPopMatrix(); if(direction==1) { …

0
48
Member Avatar for MasterHacker110

Why do i have to include stdafx.h everytime in visual C++ 2010 express. Evertime i make a project i have to include that damn header, whats so special about it and how can i avoid including it and still compile my program. I have tried to leave it out but …

Member Avatar for MasterHacker110
0
575
Member Avatar for citizen5

Small part of my code: `GetWindowThreadProcessId(hWnd, &dwID);` `hProcess = OpenProcess(PROCESS_ALL_ACCESS, NULL, dwID);` `string value =" [_this] exec \"\\newfolder\\scripts\\start.sqf\"";` `WriteProcessMemory(hProcess, (LPVOID) 0x09BA3F95, (LPVOID) &value, sizeof(&value), NULL);` I am 100 % sure it has to do with my `value` being a `string` but I haven't found anything helpful elsewhere, even though I've …

Member Avatar for citizen5
0
509
Member Avatar for 330xi

Hi! In my program MFC Doc/view one view constantly displaying what the camera is "seeing". After some event I want to show in the other window - dialog the image that has been in the view in the moment of event. I have code in Dialog window that succesfully draws …

Member Avatar for 330xi
0
150
Member Avatar for 330xi

I have this error in atlimage.h line 1568 while trying to save picture. In release mode everything is "fine" but no new file appears. Here is the code: CClientDC dc(this); CDC dcMem; CBitmap m_bmpBack; GetClientRect(&rc); hBmp = LoadImage(NULL,name,IMAGE_BITMAP,0,0,LR_LOADFROMFILE); GetObject ( hBmp, sizeof(bm), &bm ); m_bmpBack.Attach(hBmp); dcMem.CreateCompatibleDC(&dc); hbmpOld = (HBITMAP)dcMem.SelectObject(m_bmpBack); //hToSave …

Member Avatar for 330xi
0
428
Member Avatar for tweeeter

I need to modify the following program to store person objects instead of integers. Include a function to input person data from the keyboard in the person class (similar to the readRecord() function). Also add a non class function to display the list contents. Include a separate search function (search …

Member Avatar for Ancient Dragon
0
159
Member Avatar for Interista

Hi im creating a linked list with these data types etc string firstname string surname int age would anyone give a simple instruction to put these in a new node as i have tried everything but still doesnt work so far i have done this nodeType *first,*newNode, *last; cout<<"Name: "; …

Member Avatar for corby
0
2K
Member Avatar for BigEEter

Hi. I am wondering if a log file can be created in a header which is associated with a try-catch block. Below is my stripped down code for the log_header.h and log_test.cpp Here is log_header.h #include<fstream> #include<iostream> using namespace std; class thrower{ fstream myfile2; public: void errormessage(); }; void thrower::errormessage(){ …

Member Avatar for JorgeM
0
240
Member Avatar for triumphost

What should I be using? Should I be using _T? or L? Or Neither? I know some functions end with the A for Ansi and some end in W for the Unicode version but I have no clue what I want to use. if I use _T would I have …

Member Avatar for ravenous
0
267
Member Avatar for selfuser

Hai i need help in C++.. this is my code. By using this code I have to alter it and do Evolutionary Text/ Poem. The poem is : **“Berburu ke padang datar, Dapat rusa berbelang kaki, Berguru kepalang ajar, Bagai bunga kembang tak jadi.” ** **There are 3 files.. Evo0.cpp(below …

Member Avatar for PrimePackster
0
273
Member Avatar for rafaquatbutt

we need to solve the following question. Write a program that asks the user for a word, and then prompts a user for a letter. Your program should count the number of times the letters entered appear in the word, and then continue prompting for new letters. The program should …

Member Avatar for PrimePackster
0
321
Member Avatar for yoni0505

Hi, I'm experimenting with A Star pathfinding. I'm having a problem with a function. I'm getting the next error after running it: > Unhandled exception at 0x76ec15de in A Star Pathfinding.exe: 0xC0000005: Access violation reading location 0x08e463a8. the function's code is: void addAdjacent(list* oList, list* cList, int tileMap[][40]) { node* …

Member Avatar for yoni0505
0
1K
Member Avatar for stereomatching

template<typename View> struct pixel_traits; template<> struct pixel_traits<gray8c_view_t> { typedef gray8c_pixel_t type; } Could I find something like this from gil?Thanks

0
70
Member Avatar for Valiantangel

double a [3]={1.1,2.2,3.3}; cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<endl; a[1]=a[2]; cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<endl; ans to the above is 1.1 2.2 3.3 1.1 3.3 3.3 I am new to array. Please expalin why a[1]=a[2] gave me 3.3 3.3. thank you

Member Avatar for jaskij
0
94
Member Avatar for cppgangster

Dear all, How to read a file with particural encoding like UTF -8 or UTF- 16. Do I need to use some special library?

Member Avatar for rubberman
0
121
Member Avatar for FelineHazard

Hi all, I have a rather basic C/C++ question about the priority of the ++ operator in regard to pointers. Note the following code (joining two strings): #define LENGTH 255 void mystrcat (char *base, char *add) { while(*base) ++base; while( *(base++) = *(add++) ); } int main() { char name[LENGTH]="Feline"; …

Member Avatar for rubberman
0
662
Member Avatar for jakezcop

int Finish()//outputs stored values to file { ofstream walletfile; walletfile.open("C:/accounts/wallet.acnt", ios::trunc); walletfile << wallet; walletfile.close(); ofstream accountfile; accountfile.open("C:/accounts/account.acnt", ios::trunc); accountfile << account; accountfile.close(); ofstream savingsfile; savingsfile.open("C:/accounts/savings.acnt", ios::trunc); savingsfile << savings; savingsfile.close(); return 0; } I am a brand new programmer, just learning from the web, i wrote this function as …

Member Avatar for jakezcop
0
2K
Member Avatar for triumphost

Is it necessary to seperate the headers from the source? For example I don't know why but I love to do: //Foo.H class Foo { Foo(){} ~Foo(){} void Func() { //......... //......... } void Func2() { //........ //........ } }; Instead of doing: //Foo.H class Foo { Foo(); ~Foo(); void …

Member Avatar for mike_2000_17
0
2K
Member Avatar for MrEARTHSHAcKER

Hi, Can you tell me how can I make my application recognizes when the user presses a button on keyboard? *For example*: presses 'S', application prints "Hello.". I need this information for BorlandC++, but it would be useful even though you provide the same for VC++ :) *(I am not …

Member Avatar for triumphost
0
329
Member Avatar for rannamaa

Im making a program in wich I need to monitore (import) a variable (number from an other program window every time the variable changes. There are very much other information in this window but I only want this number that is occuring at a sertain position in the window. How …

Member Avatar for triumphost
0
161
Member Avatar for cent91

hello everyone. i am at such a stage where i need to make a decision. i have gained enough basic programming skills withn c++ and now i want to start with something a little professional. i dont like web programming and i would love to do system programming or game …

Member Avatar for thines01
0
627
Member Avatar for Chuckleluck

Hello, I'm fairly new to programming, and I'm not exactly sure how to do line-rect collision detection. If it helps, I'm using SFML 2. Can someone explain to me how I would go about coding line-rect collision detection? Thanks in advance.

Member Avatar for adityatandon
0
226
Member Avatar for triumphost

Currently I use: DWORD ThreadProc(LPVOID lpParameter) { void (* function)() = (void (*)())lpParameter; function(); return 0; } void Threading(HANDLE &hThread, DWORD &ThreadID, void* FunctionToPass) { hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProc, (void*)FunctionToPass, 0, &ThreadID); } And I want to call it like: Handle hThread; DWORD ThreadID; Threading(hThread, ThreadID, AnyFunctionHere); That way …

Member Avatar for mike_2000_17
0
453
Member Avatar for Suzie999

Whenever I create some small tool in c++ dll for use with another language, a new user always has to download the microsoft redistributable package and install it. Is there anyway to add the resources needed from the redist, to my dll? How even do you know what resources it …

Member Avatar for Suzie999
0
183

The End.