diff --git a/cg/library/GLRF.md b/cg/library/GLRF.md index f007f2c..d308ddd 100644 --- a/cg/library/GLRF.md +++ b/cg/library/GLRF.md @@ -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有效之间进行操作 @@ -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类型,还没有测试通过 \ No newline at end of file diff --git a/cpl/language.md b/cpl/language.md index 3a189b7..a907ddc 100644 --- a/cpl/language.md +++ b/cpl/language.md @@ -44,4 +44,5 @@ rust语言的安全,就是通过所有权的确定来保证在运行期不会 ## 工具 ### [正则表达式regular expression](https://www.regular-expressions.info/) -[js RegExp](/cpl/js/regularExpressions.js) \ No newline at end of file +- [New regular expression features in ECMAScript 6](https://2ality.com/2015/07/regexp-es6.html) +- [js RegExp](/cpl/js/regularExpressions.js) \ No newline at end of file diff --git a/index.mjs b/index.mjs index 10f8e16..0415668 100644 --- a/index.mjs +++ b/index.mjs @@ -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)); } } @@ -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); /**