|
Some recent topics started on our forums |
Loading Data from a C++ Program
|
Hi,
I have a C++ program that generates data and stores it in a binary file. In C++, the data can then be loaded with this:float* tsatData = new float[ width * height * 3 * depth ];
FILE* fHandle = fopen(filePath.c_str(), "rb");
if (fHandle !... |
Posted December 31, 2010 6:43:15 PM
|
Using fread to Read a Text File
|
Hi,
I'm trying to read a file very quickly. I My tests have shown that reading line by line with "getline()" is slower than seeking to the end of the file and then reading it all at once with fread. Right now, I'm trying to get fread to wor... |
Posted December 23, 2010 3:24:10 PM
|
Arrays versus Linked Lists
|
Hi,
I have a Python library I wrote, that I am now converting to C++.
In the Python code, a list of floats is created, and a good many are added one at a time (".append()"). In the C++ code, the floats are allocated up front in an array... |
Posted December 22, 2010 12:20:01 AM
|
Destructor Called After Constructor
|
Hi,
I have the following C++ code:glLibTexture2D texture = glLibTexture2D("../testdata/Image1.png",GLLIB_ALL,GLLIB_RGBA,GLLIB_FILTER,GLLIB_MIPMAP_BLEND);
"glLibTexture2D" inherits from a class "glLibInternal_texture". Putting breakpoints in the... |
Posted December 26, 2010 10:10:06 PM
|
LNK2019 Templates
|
Hi,
I have a template function, protoype:template<typename type_float> void rotate_deg(type_float point[3], type_float vec[3], type_float theta);
Later, in my program, I call:float v1[3] = {-1.0,0.0,-1.0};
float y_axis[3] = {0,1,0};
rotat... |
Posted December 26, 2010 7:33:26 PM
|
CLR Profiler
|
Hi,
So, I'm working on an XNA application. Right now, I'm getting the stuttering effect of the garbage collector.
I'm attempting to use the CLR profiler to determine where the problems lie. I downloaded it from here, and followed the d... |
Posted December 17, 2010 2:59:00 PM
|
Stuttering Framerate
|
Hi,
Using XNA 4.0.
For my purposes, I need exactly one Update call for every Draw call. I also want the game to run at a maximum speed of 60Hz. I also want it to decrease as necessary. Currently, my attempt at doing most of this is:this... |
Posted December 7, 2010 5:22:51 AM
|
Movie Playback Delay
|
Hi,
When starting to play a movie in XNA 4.0, using a VideoPlayer, the program hangs for a few seconds before playing the clip. Presumably, the player is buffering the clip or something.
This is a problem in my application. Is there a way to... |
Posted December 6, 2010 5:01:49 PM
|
Syncing Update and Draw at a Target Framerate
|
Hi,
I'd like to be able to have the calls between Update and Draw be synchronized (i.e., have exactly one Update call for every Draw call) AND be called at exactly 60Hz.
In the Initialize function, I tried the following, which didn't help:... |
Posted December 6, 2010 12:54:32 AM
|
HLSL Mipmapping on XBox360
|
Hi,
My code runs perfectly on my computer. I have many shaders with samplers that look likesampler2D diffuse_sampler = sampler_state {
Texture = (diffuse_texture);
MipFilter = LINEAR; MinFilter = MIN_MAG_MIP_LINEAR; MagFilter = LIN... |
Posted December 1, 2010 5:44:02 PM
|
View All Topics Started By This User
|
|
Some recent replies made on our forums |
Usage of mipmapping in GUI's?
|
Hi,
Ideally, GUI assets should be made (by artists or procedurally) at the right scale to begin with (because resolutions change, I favor procedurally, or a mix of both).
Mipmapping is a minification filter. So yes, it's applicable if you're... |
Posted January 4, 2011 9:23:52 PM
|
Hex Heightmap
|
Un-bee-lievable! |
Posted January 3, 2011 11:44:37 AM
|
Loading Data from a C++ Program
|
Quote:tsatData = array.array('f', fHandle.read())
fHandle.close()Thanks! |
Posted January 2, 2011 4:55:19 PM
|
Using fread to Read a Text File
|
I think the trouble was the carriage returns. Thanks! |
Posted December 28, 2010 10:35:42 PM
|
Arrays versus Linked Lists
|
Quote:So, my suggestion, move the conversion of the model to an offline process, then you don't have to worry about how fast it is.It's a library, and I want it to be able to load .obj files quickly, even if it will convert them to another faster (bi... |
Posted December 28, 2010 10:33:30 PM
|
Destructor Called After Constructor
|
I figured it out. The private members were of glLibInternal_texture, not glLibTexture2D. |
Posted December 27, 2010 1:05:26 PM
|
Destructor Called After Constructor
|
Ah thanks; that was the problem.
After some more investigation, this has shown an underlying problem in the code that requires a copy constructor to fix (not for the example above, but for other circumstances).
I've set up a copy constructor fo... |
Posted December 27, 2010 2:26:50 AM
|
LNK2019 Templates
|
I didn't try to implement the code using it (for portability), but typing "export" seemed to be recognized, so I assumed it was usable for the compiler. |
Posted December 26, 2010 8:57:51 PM
|
LNK2019 Templates
|
Looks like VS2010 at least supports "export". For portability, I moved all the template functions into the header file, which seems to have fixed it.
Thanks,
G |
Posted December 26, 2010 7:53:11 PM
|
Using fread to Read a Text File
|
In "r" mode, the difference between result and lSize seems to be the number of newlines in the file. However, removing all newlines results in garbage again! |
Posted December 23, 2010 3:33:20 PM
|
View All Replies Made By This User
|