Posted: Tue Nov 16, 2010 12:57 am Post subject: RE:Compiling Open Source Projects
okay I added the .lib file to the linker's additional dependencies list... but the above problems still exist.
Edit: There was actually two library files to include, and I forgot I was working with a different project than normal. But now it actually compiled and ran (although since I cut out the code that displays the video and stuff it's not very useful.) Time to test it out a little, then next step, compile all this as a .dll so I can utilize it with C#
Edit2: So now I don't know how to actually create any sort of graphical ouput in C. Here's the function I need to replicate (this uses glut and pthread, both of which are really awkward and dificult to use on windows). Is there some sort of way to just draw a screen with the data sent to this function, it doesnt have to be fancy, doesnt have to be fast, doesnt have to be cross-platform or extendable, I just need to get something working like right now to make sure that the device is working correctly.
void rgbimg(uint8_t *buf, int width, int height)
{
int i;
Posted: Tue Nov 16, 2010 2:08 am Post subject: Re: Compiling Open Source Projects
If I'm correct in assuming that the function is copying the the raw pixel data to opengl's rgb buffer, you can probably just replace it with a glDrawPixels call.
code:
void rgbimg(uint8_t *buf, int width, int height)
{
glDrawPixels(width, height, GL_RGB, GL_UNSIGNED_BYTE_2_3_3, buf);
}
If you get output, but the colours are incorrect, try changing the 4th parameter to _3_3_2 instead of _2_3_3.
Of course, I could be completely misreading that function (I have no idea how pthread works or what it does,) but I see no reason why the library should be using a memcpy for video output.
As for actually getting yourself a rendering context (assuming you don't already have a window to render to,) I recommend SDL, since it's simple, effective, and best of all has a pre-compiled library, meaning it isn't any hassle to get it running.