Archived

This topic is now archived and is closed to further replies.

confused by code sent by friend

This topic is 5133 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is my dilemia. Im currently making a project(not my first by any means but my first with OpenGL, I have used winAPI before though) that is requiring alot of graphic code. Since I''m on serious time constraints(I need it done by December 10th) I enlisted some help from a friend and a member here(don''t know his username on this but his AIM name is aGaBoOgAmOnGeR ) to help with OpenGL since I really don''t have time to learn a new language but I plan to learn it once Im done with this project. My problem being he sent me some very small code to use as a wrapper(included below) but unfortunitly he left almost immediatly after sending it on a family trip for thanksgiving. All he told me was there is a small error in it so it doesn''t work but he needs like 5 minutes to fix and he had to leave. He sent it so I could continue work. Now I was wondering if anyone here could possibly find the error in the code and explain to me how to use it since it looks like there is no code just 5 function prototypes. Also are thee spose to be 3 includes there? Anyways if anyone can help me here is the code:
#ifndef GLCLIB_H
#define GLCLIB_H
#include 
#include 
#include 


// Functions in this reader returning int (unless otherwise specified) indicate success with 0 and failure with nonzero

typedef struct{	
	HGLRC hRC;	HDC   hDC;}
	glc_context;

typedef struct{
	unsigned int tid;	int sx,sy;}
	glc_texture;

// db stands for double-buffer, 0 = false, 1 = trueglc_context 

*glc_create_context(HWND hwnd,HDC hDC,int db);
int glc_destroy_context(glc_context *op);
int glc_resize_context(glc_context *op, int sx,int sy);
int glc_swap_buffers(glc_context *op);
glc_texture *glc_load_bitmap(glc_context *op,int sx,int sy,unsigned char *imgdata);
int glc_clear_context(glc_context *op,unsigned char red,unsigned char green,unsigned char blue);
int glc_draw_bitmap(glc_texture *source,int sx1,int sy1,int sx2,int sy2,glc_context *dest,int dx1,int dy1,int dx2,int dy2);
int glc_draw_line(glc_context *dest,unsigned char red,unsigned char green,unsigned char blue,int x1,int y1,int x2,int y2);
int glc_draw_circle(glc_context *dest,unsigned char red,unsigned char green,unsigned char blue,int cx,int cy,int radius);

#endif//GLCLIB_H
 
Thanks for the help. And that is EXACTLY how I got it(copy-paste). Ray Koons

Share this post


Link to post
Share on other sites
Wow, your friend is a jackass. All he sent you was a header filed. In other words, you can''t do anything with the code. I would leave him out of the project and do a google search for NeHe, as he said (I am trusting him here, I know DirectX, not OpenGL).

Share this post


Link to post
Share on other sites
nevermind, I re-read our convosationa nd relized that what he did was send me the headerfile so i new what the function calls and all were to implement them and then he would get the full code when he gets back and gets it working. Well that solves that problem but can any tell me what the 3 #includes are there for and how to get them working?

Share this post


Link to post
Share on other sites