C++ :: How Do Games Change Meshes At Runtime
Jun 25, 2014
Right, I'm making a game and I'm not sure how I'm going to do this:
On Skyrim (for example; there are thousands of others), when you equip a helmet, it appears on your character's mesh.
How do they do that? Do they modify the mesh, or simply render the helmet at a location which makes it look like it is on their head, or what?
View 2 Replies
ADVERTISEMENT
Feb 23, 2015
how to change the mouse tracking icon during runtime. I wish to emulate the Microsoft Paint app behavior with respect, for example, to click on a toolbar button such as the 'Fill With Color' bucket and have the mouse pointer icon change to a little bucket. I wish to do this in an MFC SDI app.
Here's a bit of code that does nothing that I can tell, although it compiles and runs. (m_hIcon2 is a member HANDLE, IDI_FLOODFILL is an existing icon in the app resources). I have come across numerous other examples that do not work and/or will not compile using VS 2010 Win7(64).
Code:
void CMainFrame::SetNewIcon() {
m_hIcon2 = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_FLOODFILL));
SetIcon(m_hIcon2, FALSE);
[Code].....
View 8 Replies
View Related
Aug 31, 2012
I have QTextEdit in mainWindow. I'm trying to resize QTextEdit so height = mainwindow.height and width = height/2. That should change when I change the size of mainWindow during runtime. How can I do that?
View 2 Replies
View Related
Oct 19, 2013
How can I determine whether there is a collision between 2 meshes? I'd just like to see if one mesh is inside another.
View 10 Replies
View Related
Oct 13, 2013
I want to make a RTS game but how can I code an AI for RTS games. How to do that?
View 5 Replies
View Related
Sep 12, 2013
How I can make 2D games in OpenGL. I have sprites, but when I load them in game, they're all big and stuff, not pixel for pixel how I'd like them. How can I do this?
View 16 Replies
View Related
Feb 20, 2013
My coin/money change code works when there can be an exact change each time, i.e. when the 1 cent option is available. However, when the change options are only $10, $5, $1, 25 cents and 10 cents, it does not give me what I want for instance, I wanted to get change for $237.80, I was expecting to get:
23 10's, one 5, two 1's and 8 dimes. However, the code below is giving me 23 10's, one 5, two 1's and 3 quarters (there is no option left for the 5 remaining cents).how to fix it?
Code:
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
void change(double cents, int a[]);
int main() {
double Dollars;
double cents;
[code]...
View 14 Replies
View Related
Apr 4, 2013
class Base
{
.....
.....
.....
virtual void display();
[code]....
in the above polymorphism why is it called runtime polymorphism when i can say seeing the code itself that display() function in derived gets executed with ptr->display(),so how does it become runtime polymorphism when i could get decide at compile itself ???
View 6 Replies
View Related
Jun 5, 2013
Here is my error message: Warning1warning C4717: 'getx' : recursive on all control paths, function will cause runtime stack overflow
and here is my code I will Bold the part that is giving me problems!
class point
{
public:
point();
[Code]....
View 5 Replies
View Related
May 2, 2015
While running a Doc/View SDI, is there any way to switch from text mode to rtf mode during runtime? Search reveals nothing.
Say I have an editor and I want the app to use text, I can set the ctor as follows.
Code:
CEditorDoc::CEditorDoc() {
// TODO: add one-time construction code here
m_bRTF = FALSE;
}
But once I've done that and compiled the app, while it's running, is there a way for the user (or programmer) to change the mode back to RTF? One solution that occurred to me is to use 2 document classes, but that's a hassle.
View 8 Replies
View Related
Oct 21, 2012
I can not set the size of my array while running porgrama. Is there any way to do this in C + +?
---- code ------
#include <iostream>
#include <string>
using namespace std;
[Code].....
View 5 Replies
View Related
Oct 7, 2014
I am developing a small game using MFC in which the game options like new game, save, open, exit etc. can be selected from the menu as well as from the buttons inside the window. I have no problems with the menu but the buttons do not seem to work at all.
The buttons are created at runtime using CButton class. To associate the buttons with the corresponding functions, I just used the same resource ID for the buttons as the menu options, but that did not work. When I click on the buttons, nothing happens. If I assign different resource IDs to the buttons, how do I handle the message map entries? Do I have to write different message map entries for the menus and the buttons while their function is exactly the same?
View 6 Replies
View Related
Jan 14, 2014
I downloaded Oracle instantclient-basic-nt-12.1.0.1.0.zip and instantclient-sdk-nt-12.1.0.1.0.zip and extracted both to c:oracle I then went into visual studio 2013 and created a Win32 Console application with all default parms.
I then went into project -> properties -> C/C++ -> General -> Additional Include Directories and added my include path C:oraclesdkinclude
I then went into project -> properties -> Linker -> General -> Additional Library Directories and added C:oraclesdklibmsvcvc11
I then went into project -> properties -> Linker -> Input -> Additional Dependancies and added oraocci12.lib
The program compiles but when I debug i get a RUNTIME error that says "The program can't start because oraocci12.dll is missing from your computer. Try reinstalling the program to fix this problem. But I know the file exists in C:oraclesdklibmsvcvc11oraocci12.lib
This is the code if it makes a difference
Code:
#include "stdafx.h"
#include <iostream>
#include <occi.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
[Code].....
View 8 Replies
View Related
Oct 20, 2013
I've come to a point where I want to manipulate an image file at run time or with pre-determine sizes and have to be applied when the windows is moved or through in program options.
I know I can do the applying part. However I am a little unsure of how to tackle the image manipulation. I want to make it so that it is not os dependant. So I know I can not rely on any os functions. The only other thought that came to mind was to deal with the video card itself.
So the main question after all of that is said and done. How is c++ able to interact with the video card directly for images? Or if there are existing function I can use. How do they do that? If I can use existing function I would like to be able to manipulate it myself.
View 4 Replies
View Related
Feb 17, 2013
I have this TicTacToe program that needs finishing. All the code is finished, but I'm getting runtime errors. It is printing out junk values from my array when they should be empty.
//Player.h
#include <string>
#include "TTT.h"
using namespace std;
class Player {
[Code] .....
//This is a screenshot of the output. [URL] .....
View 5 Replies
View Related
Dec 4, 2013
Need fixing code to calculate male and female body fat percentages. Should a switch structure be used? Here is what I got:
#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
using namespace std;
int main() {
int bodyWeight;
double bodyFatPercent,bodyFat;
[Code] .....
View 15 Replies
View Related
Apr 25, 2013
I am getting a strange runtime error when trying to run my hash table program. I have it separated in 3 separate files. I believe I have narrowed down where the error is occurring. It is either happening in insert(const &string s) or in the implementation of vector<list<string>> ht. I would appreciate some input. This is the implementation of insert():
void HTable::insert(const string &s) {
int h = hash(s);
cout<<h<<endl;
list<string> &tempList = ht[h];
[Code] .....
And it is giving me some sort of compilation error saying I cannot convert a type string to type list.
View 1 Replies
View Related
Mar 23, 2014
I'm doing a project. And I want to give the user the ability to write methods just like you would regularly in c# during runtime and then use them during runtime. Is such thing even possible? If so how?!
View 12 Replies
View Related
Jun 18, 2014
I made a winForm with a button on it in the Designer (VS 2010 C++).
But when I run my app, the button does not show on the form.
The button visible property is set to true.
View 8 Replies
View Related
Aug 26, 2014
I somewhere read "You cannot initialize a structure like that at run time."
Example:
struct item_info {
char itemname[15];
int quantity;
float retail;
float wholesale;
[Code] ....
But if you want to assign values at run time then you have to do it manually like:
strcpy(item[0].itemname, "rice");
item[0].quantity = 10;
item[0].retail = 40;
item[0].wholesale = 30;
I tried in internet but am unable to know the differences. I want to know the difference between those two in terms of run time and compile time. Explanation required also for below one. Is this run time or compile time? How does we actually decide which is run time and which is compile time!
struct item_info {
char itemname[15];
int quantity;
float retail;
float wholesale;
//int quatityonorder;
[Code] ....
View 3 Replies
View Related
Jan 22, 2014
I am looking for a way to declare variables at run time which being a static language shouldn't happen. I will explain my situation.
I am upgrading a legacy program that modifies executables (non malicious). I am trying to add 64bit support.
It is a huge project and I understand the majority of it but my issues with how it handles the input data.
It has a struct that certain parameters of the input file is loaded into:
Code:
typedef struct DATA {
DWORD Size;
IMAGE_NT_HEADERS32 Headers;
} _DATA; *PDATA
etc, etc its a huge list.
My problem lies in the fact that I need to change IMAGE_NT_HEADERS_32 to IMAGE_NT_HEADERS64 at runtime.
That DATA struct gets called at least 110 times during runtime.
How I might tackle this? Having a conditional statement repeated that many times seems ridiculous.
View 6 Replies
View Related
Jan 13, 2015
When I am giving elements for row 2 ,program crashes .it says access violation.
Code:
#include<iostream>
#include<vector>
#include<string>
using namespace std;
void matrix_init(vector<vector<string>>& v)
[Code] ....
View 4 Replies
View Related
Apr 6, 2013
I want to extract expressions like <23.34 463.2 23.2 + *> in program runtime from the user. (I am trying to evaluate postfix expression)....
View 3 Replies
View Related
Jan 13, 2015
this application has requested the runtime to terminate it in an unusual way. contact the application support team for more information!!!
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
#include <stdlib.h>
[code].....
View 6 Replies
View Related
Apr 11, 2013
I am trying to run this program for Insertion Sort, But some how I am getting some problem:
#include<iostream>
int main(){
int i,j,key,n;
scanf("%d",&n);
int a[n];
[Code] .....
Error
In function 'int main()':
Line 10: error: ISO C++ forbids variable-size array 'a'
compilation terminated due to -Wfatal-errors.
View 2 Replies
View Related
Feb 1, 2013
I am adding int type into vector called "vi" several times like this.
std::vector<int> vi;
void addFunc(int *a, int cnt) {
vi.erase(vi.begin(), vi.end());
vi.clear();
for(int i=0; i<cnt; i++)
vi.push_back(a[i]);
}
and I call the addfunc N times every sec.
And sometimes it has runtime error on vi.push_back line.
(called stack says "_CrtIsValidHeapPointer")
View 5 Replies
View Related