wingwarp 0 Light Poster

Hello, i am trying to find the best way to incode video from a frame...

i am using directX to render a frame and then i fetch the backbuffer and i have my backbuffer i got that down and it works because i can save them to jpg's but they are uncompresed and 800x600 = 2.1 mb per frame... and its not a video...

what i want to do is take these frames and encoding them and save them to a video file (avi) i looked at DirectShow but i only found tutorials and documentation on how to create a capture device for my webcam... i just want to give it the current frame and then tell it im all done and have an AVI? is that possible or am i dreaming... i would also like for the user to be able to select the encoding type...

Its the box that shows up and asks what compression you want and it gives you the installed codecs like Intel Inter Video and Microsoft Video and Divx4... is that direct show?

anyway and soultion would be helpfull.

Thanks in advance.

wingwarp 0 Light Poster

...

thanks but i got that little part as a code snippet and i dont have a xml file opener function or id dont know i had one....


can u help again...

sorry for all the hastle...

wingwarp 0 Light Poster

i am trying to make a program for a friend and he loves an anime on utube and hates looking for the episodes so i was trying to make him a program that will opne the episode_1.html document in the folder of the saved exe.

he game me this url and i created this...

<center>
<object width="850" height="700"><param name="movie" value="<A href="http://www.youtube.com/v/Iy-SkscoPZ0"></param><embed">http://www.youtube.com/v/Iy-SkscoPZ0"></param><embed src="[URL]http://www.youtube.com/v/Iy-SkscoPZ0[/URL]" type="application/x-shockwave-flash" width="850" height="700"></embed></object>
<body bgcolor="black">
</center>

and it works great... its a music video...

and i curently have this as my c++

#include <iostream>
using namespace std;
int main(){
    int epi;
    int ever;
    
    ever=1;
    while (ever == 1){
          cout<<"type 1-197 to open that episode";
          cin>>epi;
          if (epi == 1){
                      char filename[ 20 ] = "";
                      snprintf( filename, 19, "epi1.html");
                      printf("%s\n", filename );
                      // pass filename to your xml file opening function
                      }
          }
}

any help would be great...

Please give FINE detail thanks... sometimes i can be very dumb...

wingwarp 0 Light Poster

i havent made any code yet but i was wondering if i could like...
have the user select a number and have the program open the Episode 1.html doucment...

wingwarp 0 Light Poster

ok ihave looked through google and cprograming.com and cant find much to do with opning documents like...

i am trying to do...

run the c++ program select a number and open an html document
...
...
yes i know basic html...
thanks...
--wingwarp--

wingwarp 0 Light Poster

im gonna play bf2 i have had way to much for today!....

wingwarp 0 Light Poster

You should be really ashamed of yourself saying such a stmt.

There is no such thing as good or bad book, its only the target audience that changes. Learn C++ in 24 hrs is a good book for all those who want to know the basics of C++ so that they can move on to more advanced concepts.

And do u weigh whether a book is good or bad dependign on the graphics ? Come on man u got to be joking !!!

ok if you read it that way yah i was woundering if the book was good to start graphics programming once i am done whith the basics

(yes im still looking at the big picture BUT im not learning it YET)

sorry for the misunderstanding!

-kbcubs-

wingwarp 0 Light Poster

if you have read or use Learn C++ in 24hours is it a good book to learn formor object oriented Programming in c++ is that a good book to learn OBJECT oriented programing to learn graphics...

wingwarp 0 Light Poster

Sure. Go ahead and take the long, hard path. Learning mostly with someone new, you'll likely both pick up bad habits and learn bad things to do. And synchronizing online times will be a challenge. Pokey, error prone, and problematic.

[sarcasm]
Yup, that's the approach I'd take.

It seems so much simpler than posting a question and having many eyes, and many more experience programmers, take a look at it and likely answering your questions in a quick and correct manner. This way seems to be one to avoid.
[/sarcasm]

i would advise that you folow daves advice and ask questions on the FORM not getting MUDDELED up in a whole bunch of junk in a begeners ideas of self knowlege but really will create bad habbits

please note that i am not trying to be rude i am trying to save you many hours in your path of learning C++

-kbcubs-

wingwarp 0 Light Poster

ok this will not work what im trying to do is create a game where you are a miner and need to put mines in 5 different spots im about 1/3 done but i cant get the money to come in after i build the mine i have gone through it three times maby one of yuo could help

code:

#include <iostream>
using namespace std;
int main() {
    int Y; // up-down
    int X; //left-right
    int STATION;
    int MINE;
    int YOU;
    int SCAN;
    int FUEL;
    int SEL;
    int MONEY;
    int TCOUNTER;
    
    
    MONEY = 10000;
    if (MONEY = 10000){
              cout<<"money corect\n";
    }
    else{
         MONEY = 10000;
    }
    cout<<"checking int...\n";     //////////////
    Y = 50;                        // checking //
    X = 50;                        //////////////
    if (Y == 50){
          cout<<"y corect\n";
    }
    else {
         Y = 50; //setting  int
    }
    if (X == 50){ // checking int
          cout<<"x corect\n";
    }
    else {
         X = 50; //resetting int
    }
    FUEL=10;
    if (FUEL == 10){
             cout<<"fuel corect\n";
    }
    else {
         FUEL=10;
         cout<<"fuel correct\n";
    }
    STATION = 1; //at 50,50
    if (STATION == 1){
                cout<<"station corect\n";
    }
    else {
         STATION = 1;
         cout<<"station corect\n";
    }
    while (STATION == 1){
          //------------------------------------------------------------------------------
          if (MINE == 1){
                   cout<<"you have sucessfully mined 2metric tones of\n mixed rock coal and dirt!\n";
                   cout<<"you sold the mixed dirt for 200$!";
                   MONEY = MONEY+120;
                   cout<<"taxes and gas out of 200 - 80 = 120\n";
                   }
          if (MINE == 2){
                   cout<<"you have sucessfully mined 4metric tones of\n mixed rock coal and dirt!\n";
                   cout<<"you sold the mixed …
wingwarp 0 Light Poster

ok thanks wolf pack

-kbcubs-

wingwarp 0 Light Poster

is there a way to simply tell the compiler to JUMP back to a different point???

like:

loop;
"stuff"
loop;

the first loop says where the second loop loops back to any help would help thatnks alot

-kbcubs-

wingwarp 0 Light Poster

c++ is in many games and processes are handled with C++...

IF you want to learn C++ You will need 2 things...

1. compiler
2.patience

you can find a great compiler called devc++
link:
http://ftp1.sourceforge.net/dev-cpp/devcpp4.zip

and inner patience... or a good tutorial
links:
http://www.cprogramming.com/tutorial.html#c++tutorial
http://www.cplusplus.com/doc/tutorial/

i can explain enough to compile your first program and in the begening you might feel discuraged because you are learning how the compiler reacts to different syntaxes..

once you have all of it instaled/downloaded

1.file,new,source file you should get a blank white screen! thats good!
2.go to the tutorials listed above!


REMEMBER this website has many REAL programers wandering around THEY CAN HELP feel free to post and hopfully your question will be answerd in 1-12hours!

-kbcubs-

wingwarp 0 Light Poster

Yes I know. But the point is that I wan´t to learn C++ WITH someone that mabye also want´s to learn

thats cool BUT if there is any misunderstanding come to the webpage and POST there are REAL C++ programers around this website and can answer almost ALL your small questions as i said

~friendly community~

keep up the good work and have fun programming in C++

-kbcubs-

wingwarp 0 Light Poster

i am a new c++ programer almost finished with the cprogramming.com guide i wouldnt mind helping you!...


Alwys feel free to post here "very friendly comunity"

-kbcubs-

wingwarp 0 Light Poster

ok i went throguht the cprogramming guide and im trying the other one thanks for the help i still got like five questions but ill wait till i go through the guide again just to check!


thx!

wingwarp 0 Light Poster
wingwarp 0 Light Poster

You might start by asking a specific question rather than being so vague. A person could write a book to answer your question. A TUTORIAL ON POINTERS AND ARRAYS IN C

Also, programmers eventually learn to clearly specify things and do so in plain English. You might practice that stuff too when you post questions.

I am sorry i will try to post in full english and be very specific.

wingwarp 0 Light Poster

if some one knows of a great tutorial for c++ i would be very happy..

wingwarp 0 Light Poster

ok after 4x of ppl telling me to learn the basics im starting at the bottom...
my tutorial didnt explain this function well...

what is a pointers use...

wingwarp 0 Light Poster

I double my recommendation that you learn the core language before jumping into APIs.

do you have a site that i could do that on..

i use

www.cprogramming.com

anything else?:-|

wingwarp 0 Light Poster

ok i instaled all the stuff but it still doesnt work GRRRR i can get the glut stuff to work but there are no guides fot glut only open gle and the same error keeps hapning!!:-| :-| :-|

wingwarp 0 Light Poster

ok if i wanted to create something how would i say

if (button"f") {

}

do yatta yatta

if i wanted to do that how would i... probaly a really STUPID;) quesion but here it is

wingwarp 0 Light Poster

i did that but the program still wont find the directory what should i do?

wingwarp 0 Light Poster

ok i did alll of that and it doe not work it still says invalid file or directory!...

wingwarp 0 Light Poster

Ok It Works But Does Anyone Know Of Any Opengilt, Or Gult???

wingwarp 0 Light Poster

where do i copy if im on xp...

wingwarp 0 Light Poster

AFTER 2-hours of messing around i think i finaly found the error (I THINK)

i beleve that it should be coded in

#include <windows.h>
#include <gl/gl.h>

i wanna test it but its a start!

wingwarp 0 Light Poster

ERROR:

1 C:\Dev-Cpp\main.cpp GL/glut.h: No such file or directory.

C:\Dev-Cpp\main.cpp In function `void renderScene()':

5 C:\Dev-Cpp\main.cpp `GL_COLOR_BUFFER_BIT' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
.ect


the red line is on code...

#include <GL/glut.h>

im starting to wonder if opengl is suported by my computer...

wingwarp 0 Light Poster

arrg! ok i did what u said changed the includes and this happens

29 C:\Dev-Cpp\main.cpp gl/glaux.h: No such file or directory.

39 C:\Dev-Cpp\main.cpp `HDC' does not name a type

C:\Dev-Cpp\main.cpp In function `void Render()':

406 C:\Dev-Cpp\main.cpp `g_HDC' undeclared (first use this function)

406 C:\Dev-Cpp\main.cpp `SwapBuffers' undeclared (first use this function)

ect....about 10more...

the code looks like...

/*      Steven Billington
        January 13, 2003
        May 26, 2003 - UPDATE
        RobotOGL.cpp
        [EMAIL="rod@cprogramming.com"]rod@cprogramming.com[/EMAIL]
        The following program creates a window and then
        uses multiple OpenGL functions to display a
        animated robot constructed of different size
        cubes. To compile this code you must make the
        proper library links in project--->settings.
        I apologize for any amount of scatterd code or
        mis-formatting that printing this may occur. Please
        feel free to email me at the address above for the .cpp
        file.
*/
/*      These are what we refer to as Pre-processor
        Directives. In order for certain functions in
        C++ to operate you must include certain header
        files. Each header file below contains different
        functions needed throughout this program.
*/
#pragma comment(linker, "/subsystem:windows")
#include <gl/gl.h>
#include <gl/glaux.h>
#include <gl/glu.h>
/*      Here we find a few global variables. While
        i don't really like to use global variables,
        i found them very handy for this particular
        program. These variables will control angles,
        fullscreen, and the global device context.
*/
HDC g_HDC;
float angle = 0.0f;
float legAngle[2] = {0.0f, 0.0f};
float armAngle[2] = {0.0f, 0.0f};
bool fullScreen = false;
/*      Function:       DrawCube
        Purpose:        As …
wingwarp 0 Light Poster

ARRG...
this is the error...

\DOCUME~1\KARL~1.BEC\LOCALS~1\Temp\Temporary Directory 2 for lesson01[1].zip\Lesson01\Lesson1.cpp C:\DOCUME~1\KARL~1.BEC\LOCALS~1\Temp\Temporary Directory 2 for lesson01[1].zip\Lesson01\C gl\glaux.h: No such file or directory.

this is the code...

/*
* This Code Was Created By Jeff Molofee 2000
* A HUGE Thanks To Fredric Echols For Cleaning Up
* And Optimizing This Code, Making It More Flexible!
* If You've Found This Code Useful, Please Let Me Know.
* Visit My Site At nehe.gamedev.net
*/
#include <windows.h> // Header File For Windows
#include <gl\gl.h> // Header File For The OpenGL32 Library
#include <gl\glu.h> // Header File For The GLu32 Library
#include <gl\glaux.h> // Header File For The Glaux Library
HDC hDC=NULL; // Private GDI Device Context
HGLRC hRC=NULL; // Permanent Rendering Context
HWND hWnd=NULL; // Holds Our Window Handle
HINSTANCE hInstance; // Holds The Instance Of The Application
bool keys[256]; // Array Used For The Keyboard Routine
bool active=TRUE; // Window Active Flag Set To TRUE By Default
bool fullscreen=TRUE; // Fullscreen Flag Set To Fullscreen Mode By Default
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); // Declaration For WndProc
GLvoid ReSizeGLScene(GLsizei width, GLsizei height) // Resize And Initialize The GL Window
{
if (height==0) // Prevent A Divide By Zero By
{
height=1; // Making Height Equal One
}
glViewport(0,0,width,height); // Reset The Current Viewport
glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
glLoadIdentity(); // Reset The Projection Matrix
// Calculate The Aspect Ratio Of The Window
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
glLoadIdentity(); // Reset The Modelview Matrix
}
int …
wingwarp 0 Light Poster
wingwarp 0 Light Poster

What are the error messages? Have you configured the OpenGL and DevC++ environments properly?

open gl enviroment i thought that it was built in to every computers subproceses???:?:

wingwarp 0 Light Poster

Do You Know??:-|

wingwarp 0 Light Poster

this is in an opengl guide and it wont work?? i keep getting errors at the end where the code starts to proclame the if (! statments!

heres the code thx...

/*      Steven Billington
        January 13, 2003
        May 26, 2003 - UPDATE
        RobotOGL.cpp
        rod@cprogramming.com

        The following program creates a window and then
        uses multiple OpenGL functions to display a
        animated robot constructed of different size
        cubes. To compile this code you must make the
        proper library links in project--->settings.

        I apologize for any amount of scatterd code or
        mis-formatting that printing this may occur. Please
        feel free to email me at the address above for the .cpp
        file.
*/

/*      These are what we refer to as Pre-processor
        Directives. In order for certain functions in
        C++ to operate you must include certain header
        files. Each header file below contains different
        functions needed throughout this program.
*/

#pragma comment(linker, "/subsystem:windows")

#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glaux.h>

/*      Here we find a few global variables. While
        i don't really like to use global variables,
        i found them very handy for this particular
        program. These variables will control angles,
        fullscreen, and the global device context.
*/

HDC g_HDC;
float angle = 0.0f;
float legAngle[2] = {0.0f, 0.0f};
float armAngle[2] = {0.0f, 0.0f};
bool fullScreen = false;

/*      Function:       DrawCube
        Purpose:        As the name would suggest, this is
                                the function for drawing the cubes.
*/

void DrawCube(float xPos, float yPos, float zPos)
{
        glPushMatrix();
        glBegin(GL_POLYGON);

                /*      This is the top face*/ …
wingwarp 0 Light Poster

I just cant find any good ones other than drunken hyenea-(SP) and that is verry broken up and doensnt read well i use cprogramming.com to learn my basic skills and wanted to know if there is a "GAME" development site that uses and hones the skills of a game in c++ if so plz post i am really confused i tryed python but the compiler made me frustrated because i couldnt go back and change anything without having it ENTIRLEY re compiled in the SAME program! making it like 10x slower than most other compilers! and the pygame/python guides were i have game maker six but thats a click and drag maker i wanna learn a language that has easy guides easy graphics and a FREE COMPILER.... if so plz post!

wingwarp 0 Light Poster

I am a basic c++ programer :sad: that wants to understand graphics but all the online guides confuse me i understand BASIC c++ code like...
:-|

#include <iostream>
using namespace std;
int main()
{
    int forever;
    int HIGH = 15;
    int LOW = 1;
    int HIGH1 = 50;
    int LOW1 = 0;
    int damage;
    int attack;
    int HEALTH;
    int enemyhealth;
    int travle;
    int TRYAGAIN;
    cout<<"IMPUT YOUR HEALTH\n";
    cin>>HEALTH;
    cout<<"IMPUT ENEMY HEALTH\n";
    cin>>enemyhealth;
    cout<<"1";
    cin>>forever;
    while(forever == 1) {
                  TRYAGAIN = 0;
                  damage = rand() % (HIGH - LOW);
                  attack = rand() % (HIGH1 - LOW1);
                  travle = attack-damage;
                  if (travle > 0) {
                             enemyhealth = enemyhealth-travle;
                             }
                  if (travle < 0){
                             HEALTH = HEALTH+travle;
                             }
                  if (HEALTH <0) {
                             cout<<"YOU HAVE DIED AND GONE NITHER UP NOR DOWN!";
                             system("Pause");
                             forever = -1;
                             cout<<"TRY AGAIN! 1=YES 0=NO";
                             cin>>TRYAGAIN;
                             HEALTH = +10;
                             }
                  if (enemyhealth <0){
                                  cout<<"YOU HAVE CRUSHED YOUR ENEMY";
                                  system("Pause");
                                  forever = -1;
                                  cout<<"TRY AGAIN! 1=YES 0=NO";
                                  cin>>TRYAGAIN;
                                  enemyhealth = +10;
                                  }
                  cout<<"DAMMAGE="<<travle<<"\n";
                  cout<<"YOUR HEALTH="<<HEALTH<<"\n";
                  cout<<"ENEMY HEALTH="<<enemyhealth<<"\n";
                  system("Pause\n");
                  if (TRYAGAIN == 1){
                                  forever = +1;
                                  travle = 0;
                                  TRYAGAIN = 0;
                                  cout<<"IMPUT YOUR HEALTH\n";
                                  cin>>HEALTH;
                                  cout<<"IMPUT ENEMY HEALTH\n";
                                  cin>>enemyhealth;
                                  }
                  }
 
 
    cin.get();
}

thats the most complex stuff that i understand...:-|

yeah im using dev c++