Hiya.
I'm learning OpenGL and SDL and so far I've been able to properly draw and rotate 3d polygons ( yay for me! :) )
how can I load an image file using SDL and load that texture on the 3d shapes that i draw on screen using OpenGL.
thanks!!!
update
I tried the following code that draw a cube, rotates it and adds a bitmap, but I don...
The following is the code i wrote.. I have to write it for nXn but for easyness i tried to test it for 5X5. It does not display my output... could anybody tell me whats wrong with the following code:
{
#include <iostream>
#include <iomanip>
using namespace std;
void knight ( int startx, int starty, int n, int p[][5], int used [][5], ...
I am new to MASM. So the questions may be quite basic.
When I am using the MASM assembler, there's an output file called "Link Map". Its content is composed of the starting offset and length of various segments, such as Data segment, Code segment and Stack segment. I am wondering that, where are these information describing? Are they ta...
I make regular use of forward class declarations and pointers to such classes.
I now have a need to pass a function pointer through a number of layers. I would prefer to include the header that declares my function pointer's prototype only into the module that dereferences a function pointer rather than into each layer that simply passe...
Hi I am a C++ beginner just encountered a problem I don't know how to fix
I have two class, this is the header file:
class A
{
public:
int i;
A(int a);
};
class B: public A
{
public:
string str;
B(int a, string b);
};
then I want to create a vector in main which store either class A or class B
vect...
What's a better way to clear cin input? I thought cin.clear and cin.ignore was a good way...?
code:
void clearInput()
{
cin.clear();
cin.ignore(1000,'\n');
//cin.ignore( std::numeric_limits<streamsize>::max(), '\n' );
}
My teacher gave me this reply...
this is basically saying that your
clearInput doesn't work ...
EDIT - The code looks strange here, so I suggest viewing the files directly in the link given.
While working on my engine, I came across a issue that I'm unable to resolve. Hoping to fix this without any heavy modification, the code is below.
void Block::DoCollision(GameObject* obj){
obj->DoCollision(this);
}
That is where the sta...
I have text.cpp which includes header.h and header.cpp which includes header.h.
Will header.cpp be compiled as well? I'm following a guide here, and I am thoroughly confused.
Also, what is the correct terminology for what I am asking? I know I sound like a moron, and I apologize, but I'm ignorant.
Oh, int main() is in test.cpp.
Also,...
There is 1TB data on a disk with around 1KB per data record. How to find duplicates using
512MB RAM and infinite disk space?
...
I'm using LLVM-clang on Linux.
Suppose in foo.cpp I have:
struct Foo {
int x, y;
};
How can I create a function "magic" such that:
typedef (Foo) SomeFunc(Foo a, Foo b);
SomeFunc func = magic("struct Foo { int x, y; };");
so that:
func(SomeFunc a, SomeFunc b); // returns a.x + b.y;
?
Note:
So basically, "magic" needs to tak...
I want to use boost::crc so that it works exactly like PHP's crc32() function. I tried reading the horrible documentation and many headaches later I haven't made any progress.
Apparently I have to do something like:
int GetCrc32(const string& my_string) {
return crc_32 = boost::crc<bits, TruncPoly, InitRem, FinalXor,
...
in a large listview control collection (say 5000 items), adding a SINGLE extra
item can take 10+ seconds in windows vista/7, and that's just the LVM_INSERTITEM
message handling
it looks that it only affects LVS_ICON, LVS_REPORT and LVS_LIST are still very
fast
can anybody confirm this?
the same code on windows XP with similar listview...
I noticed that if you call FindWindowEx or EnumChildWindows against a hWnd that belongs to a window that's not in the foreground, i.e. minimized, then they don't report any children. On the other hand if I first call SetForegroundWindow against the window I'm querying, and after that FindWindowEx or EnumChildWindows, they report all the ...
string s = "おはよう";
wstring ws = FUNCTION(s, ws);
How would i assign the contents of s to ws?
Searched google and used some techniques but they can't assign the exact content. The content is distorted.
...
I've been trying to implement a delete function for a Binary Search Tree but haven't been able to get it to work in all cases.
This is my latest attempt:
Node* RBT::BST_remove(int c)
{
Node* t = get_node(c);
Node* temp = t;
if(t->get_left() == empty)
*t = *t->get_left();
else if(t->get_right() == empty)
...
Hi,
I am trying to implement a min heap in c++ for a struct type that I created. I created a vector of the type, but it crashed when I used make_heap on it, which is understandable because it doesn't know how to compare the items in the heap. How do I create a min-heap (that is, the top element is always the smallest one in the heap) fo...
I'm developing a GUI in wxPython which allows a user to generate sequences of colours for some toys I'm building. Part of the program needs to load an MP3 (and potentially other formats further down the line) and display it to the user. That should be sufficient to get started but later I'd like to add features like identifying beats and...
hi, i'm programming with opengl and i want to change the camera view:
...
void RenderScene() //Zeichenfunktion
{
glClearColor( 1.0, 0.5, 0.0, 0 );
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glLoadIdentity ();
//1.Form:
glBegin( GL_POLYGON ); //polygone
glColor3f( 1.0f, 0.0f, 0.0f ); //rot
glVe...
Hello all
general question is i like to build logger class that writes to single log file
from different classes in my application what should the logger class be
singletone or static class
...
I'm looking for a script/tool that can be customized to check and enforce coding/naming conventions on a C/C++ code.
It should check for example:
Code lines are wrapped at some length.
Private variables have prefix _
Code is indented properly.
All functions are documented.
Many of the projects I'm working on are outsourced by custo...