Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

struct Texture is using "->" for acess instead of "." #41

Closed
smezzy opened this issue Jul 5, 2023 · 4 comments
Closed

struct Texture is using "->" for acess instead of "." #41

smezzy opened this issue Jul 5, 2023 · 4 comments

Comments

@smezzy
Copy link

smezzy commented Jul 5, 2023

here canvas.texture.width or canvas.texture.height gives me a compiler error cuz its trying to acesss width and height with "->" operator

	public function new(initialState:State) {
		canvas = Rl.loadRenderTexture(320, 180);
		var w = canvas.texture.width;
		var h = canvas.texture.height;
		sourceRect = Rectangle.create(-360, -180, 360, -180);
		destRect = Rectangle.create(-360, -180, 1280 + (360 * 2), 720 + (160 * 2));
		switchState(initialState);
	}
void Game_obj::__construct( ::fucciboiGDX::State initialState){
            	HX_STACKFRAME(&_hx_pos_69efd8c9269cf369_22_new)
HXLINE(  23)		this->canvas = LoadRenderTexture(320,180);
HXLINE(  24)		int w = this->canvas->texture->width;
HXLINE(  25)		int h = this->canvas->texture->height;
HXLINE(  26)		this->sourceRect = Rectangle{ (float)-360, (float)-180, (float)360, (float)-180 };
HXLINE(  27)		this->destRect = Rectangle{ (float)-360, (float)-180, (float)2000, (float)1040 };
HXLINE(  28)		this->switchState(initialState);
            	}

heres the code I was trying to copy from the raylib examples

Rectangle sourceRec = { 0.0f, 0.0f, (float)target.texture.width, -(float)target.texture.height };
    Rectangle destRec = { -virtualRatio, -virtualRatio, screenWidth + (virtualRatio*2), screenHeight + (virtualRatio*2) };

i tried patching the bindings but both RenderTexture and Texture types already have the @:structAccess modified so idk what could be wrong

@foreignsasquatch
Copy link
Owner

I can't seem to replicate this issue over here. I've had this issue before but now it seems to work. Will update if I manage to replicate this. Thank you for trying out raylib-hx

@smezzy
Copy link
Author

smezzy commented Jul 8, 2023

it seems that casting textures to a texture seems to work, read that on the raylib discord server

@swordcube
Copy link

these issues are unfortunately just caused by hxcpp being weirdly made, i can confirm casting works

@foreignsasquatch
Copy link
Owner

hxcpp is just annoying so many times

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants