Giter Club home page Giter Club logo

Comments (3)

CheapMeow avatar CheapMeow commented on July 16, 2024 1

Bug of window signal connection is because there is no glfw window in Windows instance.
Windows class use AddWindow() to create glfw window, this function should be called externally form Windows class, but the situation is that Editor project don't have the call. So when code run into signal connection, it get an empty pointer and call OnKey() at empty pointer.
To solve it, I hack AddWindow() in Windows class ctor at first. It may disobey the author's design.

After this hack, I continue geting bug of pointer of renderpass is empty. It should be created in RenderStage::Rebuild(), but the function never be called till renderpass is used. After debug, I realize that reanderpass is created in ResetRenderStages(), but my swapchains 's size = 0, so in ResetRenderStages() it doesn't call RenderStage::Rebuild(). Finally I found surface creation is connected to onAddWindow singal, but the connection happen in Graphics class ctor, and I call AddWindow() before the connection, so the onAddWindow invoke nothing.

It means the calling time of AddWindow() should be considered carefully. The calling time should be behind of Windows module creation, behind of modules that connect to onAddWindow, ahead of modules that need glfw window.

So I make the hack in GetWindow()

Sources\Devices\Windows.cpp

Window *Windows::GetWindow(WindowId id) {
	// hack
	if (windows.size() == 0 && id == 0)
		AddWindow();

	if (id >= windows.size())
		return nullptr;
	return windows.at(id).get();
}

Then editor project should run.

from acid.

kyriewxcode avatar kyriewxcode commented on July 16, 2024

我也遇到一样的问题

from acid.

linuxing3 avatar linuxing3 commented on July 16, 2024

Can't start in Linux
swappy-20230821_185628

from acid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.