Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lmj01 committed May 11, 2024
1 parent a953fc6 commit a5993aa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
7 changes: 6 additions & 1 deletion cg/library/GLRF.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [GLRF](https://github.com/lmj01/GLRF)
> OpenGL Realtime Framework
## FrameBuffer.hpp
## FrameBuffer.hpp/cpp
配置GL_FRAMEBUFFER,并绑定n(>=1)个GL_COLOR_ATTACHMENT0+n关联GL_TEXTURE_2D,如果有depth buffer,也配置好

注意两个函数都是在glBindFramebuffer有效之间进行操作
Expand All @@ -18,3 +18,8 @@ glDrawBuffers(config.num_color_buffers, attachments);
### [glFramebufferRenderbuffer](https://registry.khronos.org/OpenGL-Refpages/gl4/html/glFramebufferRenderbuffer.xhtml)
> attach a renderbuffer as a logical buffer of a framebuffer object
Renderbuffers cannot be attached to the default draw and read framebuffer
## Shader.hpp/cpp
创建shader对象,就是一个pipeline的过程,很轻微的绑定了material逻辑在其中,uniform等参数通过configuration来配置,很简洁清晰
configuration相当于存储所有的uniform等参数,很集中存放数据,更新时通过loadIntoShader来赋值
这里增加了全shader type,为了测试面片处理的shader,在GLRF::SceneMesh::draw时还没有处理GL_PATCHES类型,还没有测试通过
3 changes: 2 additions & 1 deletion cpl/language.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ rust语言的安全,就是通过所有权的确定来保证在运行期不会
## 工具

### [正则表达式regular expression](https://www.regular-expressions.info/)
[js RegExp](/cpl/js/regularExpressions.js)
- [New regular expression features in ECMAScript 6](https://2ality.com/2015/07/regexp-es6.html)
- [js RegExp](/cpl/js/regularExpressions.js)
13 changes: 11 additions & 2 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ function updateContent(text, options = {}) {
elContent.appendChild(elIframe);
} else {
elContent.classList.remove('iframe');
elContent.innerHTML = marked.parse(text);
if (options.isSourceFile) {
const elPre = document.createElement('pre');
elPre.textContent = text;
elContent.replaceChildren();
elContent.appendChild(elPre);
} else {
elContent.innerHTML = marked.parse(text);
}

document.querySelectorAll('.main-content a').forEach(a=>tagLinkUpdateEvent(a));
}
}
Expand All @@ -33,10 +41,11 @@ function tagLinkClickCaption(event, aLink) {
event.preventDefault();
const isSameOrigin = aLink.href.startsWith(rootOrigin) && ['.md','.js','.cpp','.lua'].find(e=>aLink.href.endsWith(e));
if (isSameOrigin) {
const isSourceFile = !aLink.href.endsWith('.md');
// 只解析本地的markdown文件
const tmp = `${rootRelative}${aLink.href.replace(rootOrigin,'').replace(rootRelative, '').replace('//', '/')}`;
fetch(tmp)
.then(res=>res.text()).then(text=>updateContent(text));
.then(res=>res.text()).then(text=>updateContent(text, {isSourceFile}));
} else {
// window.open(aLink.href);
/**
Expand Down

0 comments on commit a5993aa

Please sign in to comment.