Jump to content
  • Advertisement
_WeirdCat_

C++ Wrong parameters in void call

Recommended Posts

for (int i=0; i < 3; i++)
	PROJECTION_FORMS[i].Initialize(&grid_size, &FPP_CAM, &grid_shader, Font, &FULLSCR_VBUFF,
		&projection_background_color, &projection_grid_color, &projection_line_thickeness,
		first_model_object, &wireframe_shader, i, &projection_line_thickeness);//this line seems to be causing problem

 

 

where

 

	void Initialize(float * grid_size_ptr, TSpecCamera * spectator, TShaderObject * gridshader, TGLFont * afont,
			unsigned int * afullscrvbuff,
	vec3 * abgcol, vec3 * gridcol, float * lthick, TachoGLModel<float> * afirst_model_object, TShaderObject * awireframeshader,
	int init_projection, vec3 * awireframe_color)

 

 

and where


struct TMainModelEditor : public TGLForm
{
	TGLForm * Forms[ max_net_forms ];
	TGLForm * actual_visible_form;

TachoGLModel<float> * first_model_object;

TSideProjectionForm PROJECTION_FORMS[3];

TShaderObject grid_shader;
TShaderObject wireframe_shader;
TShaderObject projection_shader;
TShaderObject projection_selection_shader;
TShaderObject fppview_shader;
TShaderObject fppview_selection_shader;

float grid_size;
TSpecCamera FPP_CAM;
TGLFont * Font;

unsigned int FULLSCR_VBUFF;
T2DVertex fvbuff[4];

vec3 projection_background_color;
vec3 projection_grid_color;
float projection_line_thickeness;
vec3 projection_wireframe_color;

vec3 selection_color;

};

 

 

seems like all pointers are setup good except not

Description    Resource    Path    Location    Type
no matching function for call to 'TSideProjectionForm::Initialize(float*, TSpecCamera*, TShaderObject*, TGLFont*&, unsigned int*, vec3*, vec3*, float*, TachoGLModel<float>*&, TShaderObject*, int&, float*)'    main_framework.h    /WiredNavalBattle/jni/Editor/netforms    line 80    C/C++ Problem
 

 

looks like compiler somewhat converts TachoGLModel<float> * to TachoGLModel<float>*&, why is that?

Edited by Cat's machete

Share this post


Link to post
Share on other sites
Advertisement

Well, I notice you're trying to pass...

float projection_line_thickeness;

... into the last parameter, which seems to expect...

vec3 * awireframe_color

 

This is partially obscured by the very strange design pattern you seem to be using, of passing a large number of references (normally something only done for in/out parameters, not in-only parameters) into three foreign objects, each of which is expected to initialize... something? Themselves? The objects passed in?

Share this post


Link to post
Share on other sites

Lol i didnt see that thanks alot, anyway to your confusion, map editor contains, parameters as lets say color of a projection grid since we can project from side/front/top i initialuze 3 windows that need the same params, i dont have then to load shader 3 times but only once in main class, its a part of really bigger story, vcl/windows for android....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!