|
Can you write a simple code which use this code as an example?
thank very much.
|
|
|
|
|
I think the code you've provided is already an example and "simple" enough (saw the inline comments?)
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
but i put apple.bmp in the same folder with main code, write int main() to use it. then it did not work.
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(640, 480);
glutInitWindowPosition(0, 0);
glutCreateWindow("Hello OpenGL!");
OnInit();
glutDisplayFunc(OnDraw);
glutReshapeFunc(OnSize);
glutIdleFunc(OnIdle);
glutKeyboardFunc(OnKey);
glutMouseFunc(OnMouse);
glutSpecialFunc(OnKeySpecial);
LoadGLTextures();
glutMainLoop();
return 0;
}
|
|
|
|
|
Did you debug it to see if it could not find the file or bitmap failed to load? If you're using Visual Studio, I think you need to put the bitmap in the folder with the executable, not the source so Release or Debug.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
|
That's it? Where did the executable file end up?
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
the problem is:
i have this code to load bmp picture, but i don't know how to use.
int LoadGLTextures();
i only need to load bmp picture.
|
|
|
|
|
Do you still have the box your computer came in?
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
main.obj : error LNK2001: unresolved external symbol _auxDIBImageLoadA@4
Debug/main.exe : fatal error LNK1120: 1 unresolved externals
|
|
|
|
|
In your project settings, add the file Glaux.lib to your "import" box of the link section.
Hope this helps. Happy programming!
|
|
|
|
|
please share me link to down
|
|
|
|
|
You may download the latest OpenGL SDK here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
OpenGL comes with Windows
|
|
|
|
|
Not higher than 1.1. Another standards body they should have not let Microsoft join.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
I have written a C program to insert a row in SQL Server 2000 but it seems not to work.
#include<stdio.h>
#include<conio.h>
int main(void)
{
int number;
char fname[80], lname[80];
clrscr();
printf("Enter a number : ");
scanf("%d",&number);
printf("Enter your first name : ");
scanf("%s",fname);
printf("Enter your last name : ");
scanf("%s",lname);
execl sql include sqlca;
execl sql insert into Table1
values(number,",'",fname,"','",lname,"'");
getch();
return 0;
}
|
|
|
|
|
Ishaan Karnik wrote: I have written a C program to insert a row in SQL Server 2000 but it seems not to work.
Could you explain what it is that does not work?
|
|
|
|
|
The error i recieve while compiling
Compiling ..\SOURCE\SQL.C
Error ..\SOURCE\SQL.C 15: Undefined symbol 'execl'
Error ..\SOURCE\SQL.C 15: Statement missing ;
Error ..\SOURCE\SQL.C 16: Statement missing ;
|
|
|
|
|
Ishaan Karnik wrote: Undefined symbol 'execl'
Well I guess there is no such command in the C language!
|
|
|
|
|
I have taken the command from SQL The Complete Reference.
|
|
|
|
|
It looks like unix command line codes instead of C, but maybe that's just me
|
|
|
|
|
Harold (above) is correct, these are Unix commands, so unless you are compiling in a UNIX system they will not be recognised. What exactly does the SQL book say about this?
|
|
|
|
|
Ishaan Karnik wrote: execl sql include sqlca; execl sql insert into Table1 values(number,",'",fname,"','",lname,"'");
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Dear friends...
I have some clarification on C++ basic
1. "Unsigned variable” this line is accepted in C++ With out specifying any data type like "unsigned int var" or "unsigned short var", how this will allocate memory space?
2. Here is my code ( i am using Visual C++ 6.0)
String mystring ="";
getline (cin, mystring);
cout <<mystring <<="" endl;
this="" getline="" method="" expects="" 2="" "enter"="" button="" actions="" why?
3.="" and="" the="" other="" clarification="" is=""
="" cin="">>mystring;
cout <
|
|
|
|
|
1. unsigned int will take the same amount of space as a signed integer; likewise unsigned short.
2. On my system the getline() call requires only one <Enter> key.
3. cin reads into 'mystring' until it sees a space. The remainder of the line is read in by the getline() call which, by default, reads until it sees the line delimiter.
See the string::getline[^] page in MSDN for further information.
|
|
|
|
|
1. Because C standard establishes the equivalence between 'unsigned ' and 'unsigned int '. See the "ISO/IEC 9899" standard, available as PDF here [^], check out page 100 .
2. Because you can get a line only when it is (newline) terminated.
3. That's wrong: the two statements
cin >> mystring;
and
getline(cin, mystring);
are equivalent.
3. Because space is one of the string terminators for the >> operator.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Saturday, December 19, 2009 9:15 AM
|
|
|
|